Bug 391728: No placeholder for disabled plugins (frontend). r=gavin

--HG--
rename : toolkit/themes/gnomestripe/mozapps/plugins/pluginGeneric-16.png => toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked-16.png
rename : toolkit/themes/gnomestripe/mozapps/plugins/pluginGeneric.png => toolkit/themes/gnomestripe/mozapps/plugins/pluginDisabled.png
rename : toolkit/themes/pinstripe/mozapps/plugins/pluginGeneric-16.png => toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked-16.png
rename : toolkit/themes/pinstripe/mozapps/plugins/pluginGeneric.png => toolkit/themes/pinstripe/mozapps/plugins/pluginDisabled.png
rename : toolkit/themes/winstripe/mozapps/plugins/pluginGeneric-16-aero.png => toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16-aero.png
rename : toolkit/themes/winstripe/mozapps/plugins/pluginGeneric-16.png => toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16.png
rename : toolkit/themes/winstripe/mozapps/plugins/pluginGeneric-aero.png => toolkit/themes/winstripe/mozapps/plugins/pluginDisabled-aero.png
rename : toolkit/themes/winstripe/mozapps/plugins/pluginGeneric.png => toolkit/themes/winstripe/mozapps/plugins/pluginDisabled.png
This commit is contained in:
Dave Townsend 2008-09-30 07:31:19 +01:00
Родитель a6f84d1f4f
Коммит 9bbca4c054
21 изменённых файлов: 171 добавлений и 42 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -23,3 +23,5 @@
<!ENTITY missingPlugin.label "Click here to download plugin.">
<!ENTITY disabledPlugin.label "The plugin for this content has been disabled. Click here to manage your plugins.">
<!ENTITY blockedPlugin.label "This plugin has been blocked for your protection.">
<!ENTITY disabledPlugin.label "The plugin for this content has been disabled. Click here to manage your plugins.">
<!ENTITY blockedPlugin.label "This plugin has been blocked for your protection.">

Просмотреть файл

@ -50,8 +50,10 @@
(i.e. for a11y reasons. see Bug 245349).
-->
<html:a href="#">
<xul:image id="missingPluginPlaceholder"/>
&missingPlugin.label;
<xul:vbox>
<xul:image id="missingPluginPlaceholder"/>
<xul:description>&missingPlugin.label;</xul:description>
</xul:vbox>
</html:a>
<!-- Make our fallback content disappear (XBL requires this) -->
@ -72,4 +74,57 @@
</handlers>
</binding>
<binding id="disabledPlugin" inheritstyle="false">
<resources>
<stylesheet src="chrome://mozapps/skin/plugins/missingPlugin.css"/>
</resources>
<content>
<!-- This uses html:a instead of something like a div so that it can be
tabbed to and just generically behaves more like something clickable
(i.e. for a11y reasons. see Bug 245349).
-->
<html:a href="#">
<xul:vbox>
<xul:image id="disabledPluginPlaceholder"/>
<xul:description>&disabledPlugin.label;</xul:description>
</xul:vbox>
</html:a>
<!-- Make our fallback content disappear (XBL requires this) -->
<html:div style="display:none;"><children/></html:div>
</content>
<handlers>
<handler event="click" button="0">
<![CDATA[
event.preventDefault();
// Fire a PluginDisabled event to trigger the infobar
var ev = document.createEvent("Events");
ev.initEvent("PluginDisabled", true, true);
this.dispatchEvent(ev);
]]>
</handler>
</handlers>
</binding>
<binding id="blockedPlugin" inheritstyle="false">
<resources>
<stylesheet src="chrome://mozapps/skin/plugins/missingPlugin.css"/>
</resources>
<content>
<html:div>
<xul:vbox>
<xul:image id="blockedPluginPlaceholder"/>
<xul:description>&blockedPlugin.label;</xul:description>
</xul:vbox>
</html:div>
<!-- Make our fallback content disappear (XBL requires this) -->
<html:div style="display:none;"><children/></html:div>
</content>
</binding>
</bindings>

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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

Двоичные данные
toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked-16.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 565 B

Двоичные данные
toolkit/themes/gnomestripe/mozapps/plugins/pluginBlocked.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Двоичные данные
toolkit/themes/gnomestripe/mozapps/plugins/pluginDisabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Просмотреть файл

@ -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)

Просмотреть файл

@ -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;

Двоичные данные
toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked-16.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 804 B

Двоичные данные
toolkit/themes/pinstripe/mozapps/plugins/pluginBlocked.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
toolkit/themes/pinstripe/mozapps/plugins/pluginDisabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Просмотреть файл

@ -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)

Просмотреть файл

@ -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;

Двоичные данные
toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16-aero.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 539 B

Двоичные данные
toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-16.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 544 B

Двоичные данные
toolkit/themes/winstripe/mozapps/plugins/pluginBlocked-aero.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 971 B

Двоичные данные
toolkit/themes/winstripe/mozapps/plugins/pluginBlocked.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 895 B

Двоичные данные
toolkit/themes/winstripe/mozapps/plugins/pluginDisabled-aero.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 971 B

Двоичные данные
toolkit/themes/winstripe/mozapps/plugins/pluginDisabled.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 895 B