Bug 777805 - Update error message for unsupported plugins to include "Learn More..." link. r=mbrubeck

This commit is contained in:
Margaret Leibovic 2012-07-26 14:57:34 -07:00
Родитель 64477c69e0
Коммит adfc19c5fc
3 изменённых файлов: 29 добавлений и 3 удалений

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

@ -2161,6 +2161,7 @@ Tab.prototype = {
this.browser.addEventListener("scroll", this, true);
this.browser.addEventListener("MozScrolledAreaChanged", this, true);
this.browser.addEventListener("PluginClickToPlay", this, true);
this.browser.addEventListener("PluginNotFound", this, true);
this.browser.addEventListener("pageshow", this, true);
Services.obs.addObserver(this, "before-first-paint", false);
@ -2253,6 +2254,7 @@ Tab.prototype = {
this.browser.removeEventListener("DOMWillOpenModalDialog", this, true);
this.browser.removeEventListener("scroll", this, true);
this.browser.removeEventListener("PluginClickToPlay", this, true);
this.browser.removeEventListener("PluginNotFound", this, true);
this.browser.removeEventListener("MozScrolledAreaChanged", this, true);
Services.obs.removeObserver(this, "before-first-paint");
@ -2801,6 +2803,21 @@ Tab.prototype = {
break;
}
case "PluginNotFound": {
let plugin = aEvent.target;
plugin.clientTop; // force style flush
// On devices where we don't support Flash, there will be a "Learn More..." link in
// the missing plugin error message.
let learnMoreLink = plugin.ownerDocument.getAnonymousElementByAttribute(plugin, "class", "unsupportedLearnMoreLink");
if (learnMoreLink) {
let learnMoreUrl = Services.urlFormatter.formatURLPref("app.support.baseURL");
learnMoreUrl += "why-cant-firefox-mobile-play-flash-on-my-device";
learnMoreLink.href = learnMoreUrl;
}
break;
}
case "pageshow": {
// only send pageshow for the top-level document
if (aEvent.originalTarget.defaultView != this.browser.contentWindow)

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

@ -20,9 +20,16 @@
<!ENTITY pluginWizard.finalPage.moreInfo.label "Find out more about Plugins or manually find missing plugins.">
<!ENTITY pluginWizard.finalPage.restart.label "&brandShortName; needs to be restarted for the plugin(s) to work.">
<!-- LOCALIZATION NOTE (unsupportedPlatform.pre): Mobile only. Flash (the only plugin available on mobile)
is not supported on some devices. Include a trailing space as needed. -->
<!ENTITY unsupportedPlatform.pre "We're very sorry, but &brandShortName; can't play Flash on this device. ">
<!-- LOCALIZATION NOTE (unsupportedPlatform.learnMore): Mobile only. This text is used to link to a SUMO page explaining why Flash is not
supported on this device. Use the unicode ellipsis char, \u2026, or use "..." if \u2026 doesn't suit traditions in your locale. -->
<!ENTITY unsupportedPlatform.learnMore "Learn More…">
<!-- LOCALIZATION NOTE (unsupportedPlatform.post): Mobile only. Include text here if needed for your locale. -->
<!ENTITY unsupportedPlatform.post "">
<!ENTITY missingPlugin "A plugin is needed to display this content.">
<!-- LOCALIZATION NOTE (unsupportedPlatform): Mobile only. Plugins are not supported on some mobile devices. -->
<!ENTITY unsupportedPlatform "Plugins are not supported on this device.">
<!-- LOCALIZATION NOTE (tapToPlayPlugin): Mobile (used for touch interfaces) only has one type of plugin possible. -->
<!ENTITY tapToPlayPlugin "Tap here to activate plugin.">
<!ENTITY clickToPlayPlugin "Click here to activate plugin.">

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

@ -5,8 +5,10 @@
<!DOCTYPE bindings [
<!ENTITY % pluginsDTD SYSTEM "chrome://mozapps/locale/plugins/plugins.dtd">
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%pluginsDTD;
%globalDTD;
%brandDTD;
]>
<bindings id="pluginBindings"
@ -24,7 +26,7 @@
<xul:spacer flex="1"/>
<xul:box class="icon"/>
<html:div class="msg msgUnsupported">&missingPlugin;</html:div>
<html:div class="msg msgUnsupportedPlatform">&unsupportedPlatform;</html:div>
<html:div class="msg msgUnsupportedPlatform">&unsupportedPlatform.pre;<html:a class="unsupportedLearnMoreLink" href="" target="_blank">&unsupportedPlatform.learnMore;</html:a>&unsupportedPlatform.post;</html:div>
<html:div class="msg msgTapToPlay">&tapToPlayPlugin;</html:div>
<html:div class="msg msgClickToPlay">&clickToPlayPlugin;</html:div>
<html:div class="msg msgVulnerableUpdatable">&clickToPlayPluginVulnerableUpdateAvailable;</html:div>