Bug 1497940 - Part III, Remove unused pluginProblem mobile styles r=snorp
☠☠ backed out by 373839b9f787 ☠ ☠
authorTimothy Guan-tin Chien <timdream@gmail.com>
Thu, 22 Nov 2018 02:11:44 +0000
changeset 504070 6918f8e2f38cdf586b1929d71c5f85a30f4c4d45
parent 504069 54812dc57a75760aa3b4dda47f0fa3bae5b40df2
child 504071 b503b1a1552c5c92622d9a7da04a65221ae483a8
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1497940, 1381916
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497940 - Part III, Remove unused pluginProblem mobile styles r=snorp These styles and PluginHelper.js should’ve been removed back in bug 1381916. contentPluginDisabled.png is not referenced anywhere so it is deleted together. Differential Revision: https://phabricator.services.mozilla.com/D11701
mobile/android/chrome/content/PluginHelper.js
mobile/android/chrome/jar.mn
toolkit/themes/mobile/jar.mn
toolkit/themes/mobile/mozapps/plugins/contentPluginActivate.png
toolkit/themes/mobile/mozapps/plugins/contentPluginBlocked.png
toolkit/themes/mobile/mozapps/plugins/contentPluginClose.png
toolkit/themes/mobile/mozapps/plugins/contentPluginCrashed.png
toolkit/themes/mobile/mozapps/plugins/contentPluginDisabled.png
toolkit/themes/mobile/mozapps/plugins/contentPluginStripe.png
toolkit/themes/mobile/mozapps/plugins/pluginProblem.css
deleted file mode 100644
--- a/mobile/android/chrome/content/PluginHelper.js
+++ /dev/null
@@ -1,226 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-XPCOMUtils.defineLazyGetter(this, "GlobalEventDispatcher", () => EventDispatcher.instance);
-
-var PluginHelper = {
-  showDoorHanger: function(aTab) {
-    if (!aTab.browser)
-      return;
-
-    // Even though we may not end up showing a doorhanger, this flag
-    // lets us know that we've tried to show a doorhanger.
-    aTab.shouldShowPluginDoorhanger = false;
-
-    let uri = aTab.browser.currentURI;
-
-    // If the user has previously set a plugins permission for this website,
-    // either play or don't play the plugins instead of showing a doorhanger.
-    let permValue = Services.perms.testPermission(uri, "plugins");
-    if (permValue != Services.perms.UNKNOWN_ACTION) {
-      if (permValue == Services.perms.ALLOW_ACTION)
-        PluginHelper.playAllPlugins(aTab.browser.contentWindow);
-
-      return;
-    }
-
-    let message = Strings.browser.formatStringFromName("clickToPlayPlugins.message2",
-                                                       [uri.host], 1);
-    let buttons = [
-      {
-        label: Strings.browser.GetStringFromName("clickToPlayPlugins.dontActivate"),
-        callback: function(aChecked) {
-          // If the user checked "Don't ask again", make a permanent exception
-          if (aChecked)
-            Services.perms.add(uri, "plugins", Ci.nsIPermissionManager.DENY_ACTION);
-
-          // Other than that, do nothing
-        },
-      },
-      {
-        label: Strings.browser.GetStringFromName("clickToPlayPlugins.activate"),
-        callback: function(aChecked) {
-          // If the user checked "Don't ask again", make a permanent exception
-          if (aChecked)
-            Services.perms.add(uri, "plugins", Ci.nsIPermissionManager.ALLOW_ACTION);
-
-          PluginHelper.playAllPlugins(aTab.browser.contentWindow);
-        },
-        positive: true,
-      },
-    ];
-
-    // Add a checkbox with a "Don't ask again" message if the uri contains a
-    // host. Adding a permanent exception will fail if host is not present.
-    let options = uri.host ? { checkbox: Strings.browser.GetStringFromName("clickToPlayPlugins.dontAskAgain") } : {};
-
-    NativeWindow.doorhanger.show(message, "ask-to-play-plugins", buttons, aTab.id, options);
-  },
-
-  delayAndShowDoorHanger: function(aTab) {
-    // To avoid showing the doorhanger if there are also visible plugin
-    // overlays on the page, delay showing the doorhanger to check if
-    // visible plugins get added in the near future.
-    if (!aTab.pluginDoorhangerTimeout) {
-      aTab.pluginDoorhangerTimeout = setTimeout(function() {
-        if (this.shouldShowPluginDoorhanger) {
-          PluginHelper.showDoorHanger(this);
-        }
-      }.bind(aTab), 500);
-    }
-  },
-
-  playAllPlugins: function(aContentWindow) {
-    let cwu = aContentWindow.windowUtils;
-    // XXX not sure if we should enable plugins for the parent documents...
-    let plugins = cwu.plugins;
-    if (!plugins || !plugins.length)
-      return;
-
-    plugins.forEach(this.playPlugin);
-  },
-
-  playPlugin: function(plugin) {
-    let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-    let mimeType = objLoadingContent.actualType;
-    if (mimeType) {
-      GlobalEventDispatcher.sendRequest({ type: "PluginHelper:playFlash" });
-    }
-    if (!objLoadingContent.activated)
-      objLoadingContent.playPlugin();
-  },
-
-  getPluginPreference: function getPluginPreference() {
-    let pluginDisable = Services.prefs.getBoolPref("plugin.disable");
-    if (pluginDisable)
-      return "0";
-
-    let state = Services.prefs.getIntPref("plugin.default.state");
-    return state == Ci.nsIPluginTag.STATE_CLICKTOPLAY ? "2" : "1";
-  },
-
-  setPluginPreference: function setPluginPreference(aValue) {
-    switch (aValue) {
-      case "0": // Enable Plugins = No
-        Services.prefs.setBoolPref("plugin.disable", true);
-        Services.prefs.clearUserPref("plugin.default.state");
-        break;
-      case "1": // Enable Plugins = Yes
-        Services.prefs.clearUserPref("plugin.disable");
-        Services.prefs.setIntPref("plugin.default.state", Ci.nsIPluginTag.STATE_ENABLED);
-        break;
-      case "2": // Enable Plugins = Tap to Play (default)
-        Services.prefs.clearUserPref("plugin.disable");
-        Services.prefs.clearUserPref("plugin.default.state");
-        break;
-    }
-  },
-
-  // Copied from /browser/base/content/browser.js
-  isTooSmall: function(plugin, overlay) {
-    // Is the <object>'s size too small to hold what we want to show?
-    let pluginRect = plugin.getBoundingClientRect();
-    // XXX bug 446693. The text-shadow on the submitted-report text at
-    //     the bottom causes scrollHeight to be larger than it should be.
-    let overflows = (overlay.scrollWidth > pluginRect.width) ||
-                    (overlay.scrollHeight - 5 > pluginRect.height);
-
-    return overflows;
-  },
-
-  getPluginMimeType: function(plugin) {
-    var tagMimetype = plugin.actualType;
-
-    if (tagMimetype == "") {
-      tagMimetype = plugin.type;
-    }
-
-    return tagMimetype;
-  },
-
-  handlePluginBindingAttached: function(aTab, aEvent) {
-    let plugin = aEvent.target;
-    let doc = plugin.ownerDocument;
-    let overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main");
-    if (!overlay || overlay._bindingHandled) {
-      return;
-    }
-    overlay._bindingHandled = true;
-
-    let eventType = PluginHelper._getBindingType(plugin);
-    if (!eventType) {
-      // Not all bindings have handlers
-      return;
-    }
-
-    switch (eventType) {
-      case "PluginClickToPlay": {
-        // Check if plugins have already been activated for this page, or if
-        // the user has set a permission to always play plugins on the site
-        if (aTab.clickToPlayPluginsActivated ||
-            Services.perms.testPermission(aTab.browser.currentURI, "plugins") ==
-            Services.perms.ALLOW_ACTION) {
-          PluginHelper.playPlugin(plugin);
-          return;
-        }
-
-        // If the plugin is hidden, or if the overlay is too small, show a
-        // doorhanger notification
-        if (PluginHelper.isTooSmall(plugin, overlay)) {
-          PluginHelper.delayAndShowDoorHanger(aTab);
-        } else {
-          // There's a large enough visible overlay that we don't need to show
-          // the doorhanger.
-          aTab.shouldShowPluginDoorhanger = false;
-          overlay.classList.add("visible");
-        }
-
-        // Add click to play listener to the overlay
-        overlay.addEventListener("click", function(e) {
-          if (!e.isTrusted)
-            return;
-          e.preventDefault();
-          let win = e.target.ownerGlobal.top;
-          let tab = BrowserApp.getTabForWindow(win);
-          tab.clickToPlayPluginsActivated = true;
-          PluginHelper.playAllPlugins(win);
-
-          NativeWindow.doorhanger.hide("ask-to-play-plugins", tab.id);
-        }, true);
-
-        // Add handlers for over- and underflow in case the plugin gets resized
-        plugin.addEventListener("overflow", function(event) {
-          overlay.classList.remove("visible");
-          PluginHelper.delayAndShowDoorHanger(aTab);
-        });
-        plugin.addEventListener("underflow", function(event) {
-          // This is also triggered if only one dimension underflows,
-          // the other dimension might still overflow
-          if (!PluginHelper.isTooSmall(plugin, overlay)) {
-            overlay.classList.add("visible");
-          }
-        });
-
-        break;
-      }
-    }
-  },
-
-  // Helper to get the binding handler type from a plugin object
-  _getBindingType: function(plugin) {
-    if (!(plugin instanceof Ci.nsIObjectLoadingContent))
-      return null;
-
-    switch (plugin.pluginFallbackType) {
-      case Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED:
-        return "PluginNotFound";
-      case Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY:
-        return "PluginClickToPlay";
-      default:
-        // Not all states map to a handler
-        return null;
-    }
-  },
-};
--- a/mobile/android/chrome/jar.mn
+++ b/mobile/android/chrome/jar.mn
@@ -25,17 +25,16 @@ chrome.jar:
   content/browser.css                  (content/browser.css)
   content/browser.js                   (content/browser.js)
   content/PresentationView.xul         (content/PresentationView.xul)
   content/PresentationView.js          (content/PresentationView.js)
   content/netError.xhtml               (content/netError.xhtml)
   content/EmbedRT.js                   (content/EmbedRT.js)
   content/MemoryObserver.js            (content/MemoryObserver.js)
   content/ConsoleAPI.js                (content/ConsoleAPI.js)
-  content/PluginHelper.js              (content/PluginHelper.js)
   content/PrintHelper.js               (content/PrintHelper.js)
   content/OfflineApps.js               (content/OfflineApps.js)
   content/MasterPassword.js            (content/MasterPassword.js)
   content/FindHelper.js                (content/FindHelper.js)
   content/PermissionsHelper.js         (content/PermissionsHelper.js)
   content/FeedHandler.js               (content/FeedHandler.js)
   content/Feedback.js                  (content/Feedback.js)
   content/Linkify.js                   (content/Linkify.js)
--- a/toolkit/themes/mobile/jar.mn
+++ b/toolkit/themes/mobile/jar.mn
@@ -43,17 +43,8 @@ toolkit.jar:
   skin/classic/global/media/audioNoAudioButton.svg         (../shared/media/audioNoAudioButton.svg)
   skin/classic/global/media/audioUnmutedButton.svg         (../shared/media/audioUnmutedButton.svg)
   skin/classic/global/media/castingButton-ready.svg        (../shared/media/castingButton-ready.svg)
   skin/classic/global/media/castingButton-active.svg       (../shared/media/castingButton-active.svg)
   skin/classic/global/media/closedCaptionButton-cc-off.svg (../shared/media/closedCaptionButton-cc-off.svg)
   skin/classic/global/media/closedCaptionButton-cc-on.svg  (../shared/media/closedCaptionButton-cc-on.svg)
   skin/classic/global/media/fullscreenEnterButton.svg      (../shared/media/fullscreenEnterButton.svg)
   skin/classic/global/media/fullscreenExitButton.svg       (../shared/media/fullscreenExitButton.svg)
-
-% skin mozapps classic/1.0 %skin/classic/mozapps/
-   skin/classic/mozapps/plugins/pluginProblem.css          (mozapps/plugins/pluginProblem.css)
-
-   skin/classic/mozapps/plugins/contentPluginActivate.png  (mozapps/plugins/contentPluginActivate.png)
-   skin/classic/mozapps/plugins/contentPluginBlocked.png   (mozapps/plugins/contentPluginBlocked.png)
-   skin/classic/mozapps/plugins/contentPluginClose.png     (mozapps/plugins/contentPluginClose.png)
-   skin/classic/mozapps/plugins/contentPluginCrashed.png   (mozapps/plugins/contentPluginCrashed.png)
-   skin/classic/mozapps/plugins/contentPluginStripe.png    (mozapps/plugins/contentPluginStripe.png)
deleted file mode 100644
index eab4439c1352f958dc246074aba6e44609df3f7f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 9f59b38e0c7c1125be88da76378fe9bea1c2eee2..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1b2e94a8085fb1ae0bf8dd4b15883082bc63d084..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1c0d5b32c78af1a1e5c27961012ec1aa2fe394b7..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 529828dc9ec091f36ec6e10d06cb99923cf4ddcc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 7fda316f34328cf3f36beda57b460f31a5cd8df1..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/toolkit/themes/mobile/mozapps/plugins/pluginProblem.css
+++ /dev/null
@@ -1,195 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-@namespace html url(http://www.w3.org/1999/xhtml);
-
-/* These styles affect only the bound element, not other page content. */
-.mainBox {
-  font: message-box;
-  font-size: 12px;
-  text-align: center;
-  display: table;
-  width: 100%;
-  height: 100%;
-  background-color: rgb(72,72,72);
-  color: white;
-  -moz-user-select: none;
-}
-
-.hoverBox {
-  display: table-cell;
-  box-sizing: border-box;
-  padding: 5px;
-  vertical-align: middle;
-  width: 100%;
-  height: 100%;
-}
-:-moz-handler-vulnerable-updatable .hoverBox:active,
-:-moz-handler-vulnerable-no-update .hoverBox:active,
-:-moz-handler-clicktoplay .hoverBox:active {
-  background-color: rgb(65, 65, 65);
-}
-
-:-moz-handler-clicktoplay .hoverBox:active .msgTapToPlay,
-:-moz-handler-clicktoplay .hoverBox:active .msgClickToPlay,
-:-moz-handler-vulnerable-updatable .hoverBox:active .msgTapToPlay,
-:-moz-handler-vulnerable-updatable .hoverBox:active .msgClickToPlay,
-:-moz-handler-vulnerable-no-update .hoverBox:active .msgTapToPlay,
-:-moz-handler-vulnerable-no-update .hoverBox:active .msgClickToPlay {
-  color: red;
-}
-
-:-moz-handler-vulnerable-updatable .hoverBox,
-:-moz-handler-vulnerable-no-update .hoverBox,
-:-moz-handler-blocked .hoverBox,
-:-moz-handler-crashed .hoverBox {
-  background-image: url(chrome://mozapps/skin/plugins/contentPluginStripe.png);
-}
-
-html|a {
-  color: white;
-}
-
-.icon {
-  width: 48px;
-  height: 48px;
-  background-position: center;
-  background-repeat: no-repeat;
-  border: none;
-  background-color: transparent;
-  -moz-user-focus: ignore;
-  margin-bottom: 6px;
-}
-
-:-moz-handler-vulnerable-updatable .icon,
-:-moz-handler-vulnerable-no-update .icon {
-  background-image: url(chrome://mozapps/skin/plugins/contentPluginBlocked.png);
-  -moz-user-focus: normal;
-}
-:-moz-handler-blocked .icon {
-  background-image: url(chrome://mozapps/skin/plugins/contentPluginBlocked.png);
-}
-:-moz-handler-clicktoplay .icon {
-  background-image: url(chrome://mozapps/skin/plugins/contentPluginActivate.png);
-  -moz-user-focus: normal;
-}
-:-moz-handler-crashed .icon {
-  background-image: url(chrome://mozapps/skin/plugins/contentPluginCrashed.png);
-}
-
-.throbber {
-  padding-left: 16px; /* width of the background image */
-  background: url(chrome://global/skin/icons/loading.png) no-repeat;
-  margin-left: 5px;
-}
-
-.msgTapToPlay,
-.msgClickToPlay {
-  text-decoration: underline;
-}
-
-@media (-moz-touch-enabled: 0) {
-  :-moz-handler-clicktoplay .msgTapToPlay {
-    display: none;
-  }
-}
-
-@media (-moz-touch-enabled) {
-  :-moz-handler-clicktoplay .msgClickToPlay {
-    display: none;
-  }
-}
-
-.submitStatus div {
-  min-height: 19px; /* height of biggest line (with throbber) */
-}
-
-.submitComment {
-  width: 340px;
-  height: 70px;
-  padding: 5px;
-  border: none;
-  border-radius: 5px;
-  resize: none;
-  font-family: inherit;
-  font-size: inherit;
-}
-
-.submitURLOptInBox {
-  text-align: start;
-}
-
-.submitURLOptIn {
-  margin-left: -1px;
-}
-
-.mainBox[chromedir="rtl"] .submitURLOptIn {
-  margin-left: 0;
-  margin-right: -1px;
-}
-
-.submitButtonBox {
-  margin-top: 7px;
-}
-
-.submitButton {
-  float: right;
-}
-
-.mainBox[chromedir="rtl"] .submitButton {
-  float: left;
-}
-
-.helpIcon {
-  display: inline-block;
-  min-width: 16px;
-  min-height: 16px;
-  background: url(chrome://mozapps/skin/plugins/pluginHelp-16.png) no-repeat;
-  cursor: pointer;
-  float: left;
-}
-
-.mainBox[chromedir="rtl"] .helpIcon {
-  float: right;
-}
-
-.closeIcon {
-  display: block;
-  width: 16px;
-  height: 16px;
-  margin-top: 4px;
-  margin-inline-start: -20px;
-  margin-inline-end: 4px;
-  border: none;
-  background-color: transparent;
-  background-image: url("chrome://mozapps/skin/plugins/contentPluginClose.png");
-  background-repeat: no-repeat;
-}
-
-.closeIcon:hover {
-  background-position: -16px 0;
-}
-
-.closeIcon:hover:active {
-  background-position: -32px 0;
-}
-
-.action-link {
-  display: inline-block;
-  border-radius: 10px;
-  background-color: rgb(35, 35, 35);
-  padding: 2px 8px;
-  margin-top: 7px;
-  text-decoration: none;
-}
-.action-link:active {
-  background-color: rgb(20, 20, 20);
-}
-
-:-moz-handler-vulnerable-updatable .action-link {
-  background-color: #a81b0c;
-}
-:-moz-handler-vulnerable-updatable .action-link:active {
-  background-color: #801409;
-}