diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index af713005d33..4771419c245 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -838,6 +838,7 @@ function prepareForStartup() { // binding can't fire trusted ones (runs with page privileges). gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, true, true); gBrowser.addEventListener("PluginBlocklisted", gMissingPluginInstaller.newMissingPlugin, true, true); + gBrowser.addEventListener("PluginDisabled", gMissingPluginInstaller.newDisabledPlugin, true, true); gBrowser.addEventListener("NewPluginInstalled", gMissingPluginInstaller.refreshBrowser, false); gBrowser.addEventListener("NewTab", BrowserOpenTab, false); window.addEventListener("AppCommand", HandleAppCommandEvent, true); @@ -5426,7 +5427,7 @@ var MailIntegration = { } }; -function BrowserOpenAddonsMgr() +function BrowserOpenAddonsMgr(aPane) { const EMTYPE = "Extension:Manager"; var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] @@ -5434,12 +5435,17 @@ function BrowserOpenAddonsMgr() var theEM = wm.getMostRecentWindow(EMTYPE); if (theEM) { theEM.focus(); + if (aPane) + theEM.showView(aPane); return; } const EMURL = "chrome://mozapps/content/extensions/extensions.xul"; const EMFEATURES = "chrome,menubar,extra-chrome,toolbar,dialog=no,resizable"; - window.openDialog(EMURL, "", EMFEATURES); + if (aPane) + window.openDialog(EMURL, "", EMFEATURES, aPane); + else + window.openDialog(EMURL, "", EMFEATURES); } function escapeNameValuePair(aName, aValue, aIsFormUrlEncoded) @@ -5518,9 +5524,6 @@ function SwitchDocumentDirection(aWindow) { SwitchDocumentDirection(aWindow.frames[run]); } -function missingPluginInstaller(){ -} - function getPluginInfo(pluginElement) { var tagMimetype; @@ -5556,6 +5559,9 @@ function getPluginInfo(pluginElement) return {mimetype: tagMimetype, pluginsPage: pluginsPage}; } +function missingPluginInstaller(){ +} + missingPluginInstaller.prototype.installSinglePlugin = function(aEvent){ var missingPluginsArray = {}; @@ -5568,7 +5574,12 @@ missingPluginInstaller.prototype.installSinglePlugin = function(aEvent){ {plugins: missingPluginsArray, browser: gBrowser.selectedBrowser}); } - aEvent.preventDefault(); + aEvent.stopPropagation(); +} + +missingPluginInstaller.prototype.managePlugins = function(aEvent){ + BrowserOpenAddonsMgr("plugins"); + aEvent.stopPropagation(); } missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ @@ -5586,7 +5597,7 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ !(aEvent.target instanceof HTMLObjectElement)) { aEvent.target.addEventListener("click", gMissingPluginInstaller.installSinglePlugin, - false); + true); } try { @@ -5594,17 +5605,8 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ return; } catch (ex) {} // if the pref is missing, treat it as false, which shows the infobar - const browsers = gBrowser.mPanelContainer.childNodes; - - var contentWindow = aEvent.target.ownerDocument.defaultView.top; - - var i = 0; - for (; i < browsers.length; i++) { - if (gBrowser.getBrowserAtIndex(i).contentWindow == contentWindow) - break; - } - - var browser = gBrowser.getBrowserAtIndex(i); + var browser = gBrowser.getBrowserForDocument(aEvent.target.ownerDocument + .defaultView.top.document); if (!browser.missingPlugins) browser.missingPlugins = {}; @@ -5617,22 +5619,23 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ // If there is already a missing plugin notification then do nothing if (notificationBox.getNotificationWithValue("missing-plugins")) return; - - var bundle_browser = document.getElementById("bundle_browser"); var blockedNotification = notificationBox.getNotificationWithValue("blocked-plugins"); - const priority = notificationBox.PRIORITY_WARNING_MEDIUM; - const iconURL = "chrome://mozapps/skin/plugins/pluginGeneric-16.png"; + var priority = notificationBox.PRIORITY_WARNING_MEDIUM; - if (aEvent.type == "PluginBlocklisted" && !blockedNotification) { - var messageString = bundle_browser.getString("blockedpluginsMessage.title"); - var buttons = [{ - label: bundle_browser.getString("blockedpluginsMessage.infoButton.label"), - accessKey: bundle_browser.getString("blockedpluginsMessage.infoButton.accesskey"), + if (aEvent.type == "PluginBlocklisted") { + if (blockedNotification) + return; + + let iconURL = "chrome://mozapps/skin/plugins/pluginBlocked-16.png"; + let messageString = gNavigatorBundle.getString("blockedpluginsMessage.title"); + let buttons = [{ + label: gNavigatorBundle.getString("blockedpluginsMessage.infoButton.label"), + accessKey: gNavigatorBundle.getString("blockedpluginsMessage.infoButton.accesskey"), popup: null, callback: blocklistInfo }, { - label: bundle_browser.getString("blockedpluginsMessage.searchButton.label"), - accessKey: bundle_browser.getString("blockedpluginsMessage.searchButton.accesskey"), + label: gNavigatorBundle.getString("blockedpluginsMessage.searchButton.label"), + accessKey: gNavigatorBundle.getString("blockedpluginsMessage.searchButton.accesskey"), popup: null, callback: pluginsMissing }]; @@ -5640,25 +5643,36 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ notificationBox.appendNotification(messageString, "blocked-plugins", iconURL, priority, buttons); } - - if (aEvent.type == "PluginNotFound") { + else if (aEvent.type == "PluginNotFound") { // Cancel any notification about blocklisting if (blockedNotification) blockedNotification.close(); - var messageString = bundle_browser.getString("missingpluginsMessage.title"); - var buttons = [{ - label: bundle_browser.getString("missingpluginsMessage.button.label"), - accessKey: bundle_browser.getString("missingpluginsMessage.button.accesskey"), + let iconURL = "chrome://mozapps/skin/plugins/pluginGeneric-16.png"; + let messageString = gNavigatorBundle.getString("missingpluginsMessage.title"); + let buttons = [{ + label: gNavigatorBundle.getString("missingpluginsMessage.button.label"), + accessKey: gNavigatorBundle.getString("missingpluginsMessage.button.accesskey"), popup: null, callback: pluginsMissing }]; - + notificationBox.appendNotification(messageString, "missing-plugins", iconURL, priority, buttons); } } +missingPluginInstaller.prototype.newDisabledPlugin = function(aEvent){ + // Since we are expecting also untrusted events, make sure + // that the target is a plugin + if (!(aEvent.target instanceof Components.interfaces.nsIObjectLoadingContent)) + return; + + aEvent.target.addEventListener("click", + gMissingPluginInstaller.managePlugins, + true); +} + missingPluginInstaller.prototype.refreshBrowser = function(aEvent) { var browser = aEvent.target; var notificationBox = gBrowser.getNotificationBox(browser); diff --git a/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd b/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd index 55d16746765..75480299bcd 100644 --- a/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd +++ b/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.dtd @@ -23,3 +23,5 @@ + + diff --git a/toolkit/mozapps/plugins/content/missingPlugin.xml b/toolkit/mozapps/plugins/content/missingPlugin.xml index 043518af8fa..a3dfeb12cd8 100644 --- a/toolkit/mozapps/plugins/content/missingPlugin.xml +++ b/toolkit/mozapps/plugins/content/missingPlugin.xml @@ -50,8 +50,10 @@ (i.e. for a11y reasons. see Bug 245349). --> - - &missingPlugin.label; + + + &missingPlugin.label; + @@ -72,4 +74,57 @@ + + + + + + + + + + + &disabledPlugin.label; + + + + + + + + + + + + + + + + + + + + + + + + &blockedPlugin.label; + + + + + + + + diff --git a/toolkit/mozapps/plugins/content/missingPluginBinding.css b/toolkit/mozapps/plugins/content/missingPluginBinding.css index 4b7fad176e4..62c11695832 100644 --- a/toolkit/mozapps/plugins/content/missingPluginBinding.css +++ b/toolkit/mozapps/plugins/content/missingPluginBinding.css @@ -41,4 +41,12 @@ object:-moz-has-handlerref:-moz-type-unsupported { -moz-binding: url('chrome://mozapps/content/plugins/missingPlugin.xml#missingPlugin') !important; } +embed:-moz-handler-disabled, applet:-moz-handler-disabled, +object:-moz-has-handlerref:-moz-handler-disabled { + -moz-binding: url('chrome://mozapps/content/plugins/missingPlugin.xml#disabledPlugin') !important; +} +embed:-moz-handler-blocked, applet:-moz-handler-blocked, +object:-moz-has-handlerref:-moz-handler-blocked { + -moz-binding: url('chrome://mozapps/content/plugins/missingPlugin.xml#blockedPlugin') !important; +} diff --git a/toolkit/themes/gnomestripe/mozapps/jar.mn b/toolkit/themes/gnomestripe/mozapps/jar.mn index 5d6966d8e97..efe723c17ff 100644 --- a/toolkit/themes/gnomestripe/mozapps/jar.mn +++ b/toolkit/themes/gnomestripe/mozapps/jar.mn @@ -11,7 +11,10 @@ classic.jar: + skin/classic/mozapps/extensions/viewButtons.png (extensions/viewButtons.png) + skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png) + skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) ++ skin/classic/mozapps/plugins/pluginDisabled.png (plugins/pluginDisabled.png) ++ skin/classic/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked.png) + skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png) ++ skin/classic/mozapps/plugins/pluginBlocked-16.png (plugins/pluginBlocked-16.png) + skin/classic/mozapps/viewsource/viewsource.css (viewsource/viewsource.css) + skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (xpinstall/xpinstallItemGeneric.png) #ifdef MOZ_PLACES diff --git a/toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked-16.png b/toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked-16.png new file mode 100644 index 00000000000..34cabf8553d Binary files /dev/null and b/toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked-16.png differ diff --git a/toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked.png b/toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked.png new file mode 100644 index 00000000000..d9aef96a2bd Binary files /dev/null and b/toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked.png differ diff --git a/toolkit/themes/gnomestripe/mozapps/plugins/pluginDisabled.png b/toolkit/themes/gnomestripe/mozapps/plugins/pluginDisabled.png new file mode 100644 index 00000000000..d9aef96a2bd Binary files /dev/null and b/toolkit/themes/gnomestripe/mozapps/plugins/pluginDisabled.png differ diff --git a/toolkit/themes/pinstripe/mozapps/jar.mn b/toolkit/themes/pinstripe/mozapps/jar.mn index 6002f18a370..29bed70fd04 100755 --- a/toolkit/themes/pinstripe/mozapps/jar.mn +++ b/toolkit/themes/pinstripe/mozapps/jar.mn @@ -21,7 +21,10 @@ classic.jar: skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png) skin/classic/mozapps/plugins/missingPlugin.css (plugins/missingPlugin.css) skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) + skin/classic/mozapps/plugins/pluginDisabled.png (plugins/pluginDisabled.png) + skin/classic/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked.png) skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png) + skin/classic/mozapps/plugins/pluginBlocked-16.png (plugins/pluginBlocked-16.png) skin/classic/mozapps/profile/profileicon.png (profile/profileicon.png) skin/classic/mozapps/profile/profileSelection.css (profile/profileSelection.css) skin/classic/mozapps/update/warning.gif (update/warning.gif) diff --git a/toolkit/themes/pinstripe/mozapps/plugins/missingPlugin.css b/toolkit/themes/pinstripe/mozapps/plugins/missingPlugin.css index 2370ab074a3..b4b3ae3b8a9 100644 --- a/toolkit/themes/pinstripe/mozapps/plugins/missingPlugin.css +++ b/toolkit/themes/pinstripe/mozapps/plugins/missingPlugin.css @@ -24,8 +24,7 @@ html|applet > *|* { height: inherit; } -html|a { - text-align: -moz-center; +html|a, html|div { display: inline-block; /* overflow:hidden makes baseline vertical-alignment act like plugins */ overflow: hidden; @@ -40,8 +39,28 @@ html|a { color: black; } +vbox { + width: inherit; + height: inherit; + -moz-box-align: center; + -moz-box-pack: center; +} + #missingPluginPlaceholder { list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png); +} + +#disabledPluginPlaceholder { + list-style-image: url(chrome://mozapps/skin/plugins/pluginDisabled.png); +} + +#blockedPluginPlaceholder { + list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked.png); +} + +#missingPluginPlaceholder, +#disabledPluginPlaceholder, +#blockedPluginPlaceholder { display: block; border: 0px; width: 32px; diff --git a/toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked-16.png b/toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked-16.png new file mode 100644 index 00000000000..0ed4fe6c7fd Binary files /dev/null and b/toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked-16.png differ diff --git a/toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked.png b/toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked.png new file mode 100644 index 00000000000..2e056995a3c Binary files /dev/null and b/toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked.png differ diff --git a/toolkit/themes/pinstripe/mozapps/plugins/pluginDisabled.png b/toolkit/themes/pinstripe/mozapps/plugins/pluginDisabled.png new file mode 100644 index 00000000000..2e056995a3c Binary files /dev/null and b/toolkit/themes/pinstripe/mozapps/plugins/pluginDisabled.png differ diff --git a/toolkit/themes/winstripe/mozapps/jar.mn b/toolkit/themes/winstripe/mozapps/jar.mn index 3525412647a..60e53f0e397 100644 --- a/toolkit/themes/winstripe/mozapps/jar.mn +++ b/toolkit/themes/winstripe/mozapps/jar.mn @@ -26,7 +26,10 @@ classic.jar: #endif skin/classic/mozapps/plugins/missingPlugin.css (plugins/missingPlugin.css) skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) + skin/classic/mozapps/plugins/pluginDisabled.png (plugins/pluginDisabled.png) + skin/classic/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked.png) skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png) + skin/classic/mozapps/plugins/pluginBlocked-16.png (plugins/pluginBlocked-16.png) skin/classic/mozapps/plugins/pluginInstallerWizard.css (plugins/pluginInstallerWizard.css) skin/classic/mozapps/profile/profileicon.png (profile/profileicon.png) skin/classic/mozapps/profile/profileSelection.css (profile/profileSelection.css) @@ -64,7 +67,10 @@ classic.jar: #endif skin/classic/aero/mozapps/plugins/missingPlugin.css (plugins/missingPlugin.css) skin/classic/aero/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric-aero.png) + skin/classic/aero/mozapps/plugins/pluginDisabled.png (plugins/pluginDisabled-aero.png) + skin/classic/aero/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked-aero.png) skin/classic/aero/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16-aero.png) + skin/classic/aero/mozapps/plugins/pluginBlocked-16.png (plugins/pluginBlocked-16-aero.png) skin/classic/aero/mozapps/plugins/pluginInstallerWizard.css (plugins/pluginInstallerWizard.css) skin/classic/aero/mozapps/profile/profileicon.png (profile/profileicon-aero.png) skin/classic/aero/mozapps/profile/profileSelection.css (profile/profileSelection.css) diff --git a/toolkit/themes/winstripe/mozapps/plugins/missingPlugin.css b/toolkit/themes/winstripe/mozapps/plugins/missingPlugin.css index 2370ab074a3..b4b3ae3b8a9 100644 --- a/toolkit/themes/winstripe/mozapps/plugins/missingPlugin.css +++ b/toolkit/themes/winstripe/mozapps/plugins/missingPlugin.css @@ -24,8 +24,7 @@ html|applet > *|* { height: inherit; } -html|a { - text-align: -moz-center; +html|a, html|div { display: inline-block; /* overflow:hidden makes baseline vertical-alignment act like plugins */ overflow: hidden; @@ -40,8 +39,28 @@ html|a { color: black; } +vbox { + width: inherit; + height: inherit; + -moz-box-align: center; + -moz-box-pack: center; +} + #missingPluginPlaceholder { list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png); +} + +#disabledPluginPlaceholder { + list-style-image: url(chrome://mozapps/skin/plugins/pluginDisabled.png); +} + +#blockedPluginPlaceholder { + list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked.png); +} + +#missingPluginPlaceholder, +#disabledPluginPlaceholder, +#blockedPluginPlaceholder { display: block; border: 0px; width: 32px; diff --git a/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16-aero.png b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16-aero.png new file mode 100644 index 00000000000..5d796cc4c57 Binary files /dev/null and b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16-aero.png differ diff --git a/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16.png b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16.png new file mode 100644 index 00000000000..d6dffb29b4f Binary files /dev/null and b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16.png differ diff --git a/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-aero.png b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-aero.png new file mode 100755 index 00000000000..d8b270ae522 Binary files /dev/null and b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-aero.png differ diff --git a/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked.png b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked.png new file mode 100644 index 00000000000..3e6d43c9ac1 Binary files /dev/null and b/toolkit/themes/winstripe/mozapps/plugins/pluginBlocked.png differ diff --git a/toolkit/themes/winstripe/mozapps/plugins/pluginDisabled-aero.png b/toolkit/themes/winstripe/mozapps/plugins/pluginDisabled-aero.png new file mode 100755 index 00000000000..d8b270ae522 Binary files /dev/null and b/toolkit/themes/winstripe/mozapps/plugins/pluginDisabled-aero.png differ diff --git a/toolkit/themes/winstripe/mozapps/plugins/pluginDisabled.png b/toolkit/themes/winstripe/mozapps/plugins/pluginDisabled.png new file mode 100644 index 00000000000..3e6d43c9ac1 Binary files /dev/null and b/toolkit/themes/winstripe/mozapps/plugins/pluginDisabled.png differ