mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 725286 - Plugin placeholder text for the unsupported platforms is misleading. r=blassey,dolske
This commit is contained in:
parent
00bff6eb88
commit
cbd6ff9d26
@ -41,6 +41,7 @@
|
||||
#include "nsPluginError.h"
|
||||
|
||||
// Util headers
|
||||
#include "prenv.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
@ -1220,9 +1221,16 @@ nsObjectLoadingContent::ObjectState() const
|
||||
case ePluginCrashed:
|
||||
state |= NS_EVENT_STATE_HANDLER_CRASHED;
|
||||
break;
|
||||
case ePluginUnsupported:
|
||||
state |= NS_EVENT_STATE_TYPE_UNSUPPORTED;
|
||||
case ePluginUnsupported: {
|
||||
// Check to see if plugins are blocked on this platform.
|
||||
char* pluginsBlocked = PR_GetEnv("MOZ_PLUGINS_BLOCKED");
|
||||
if (pluginsBlocked && pluginsBlocked[0] == '1') {
|
||||
state |= NS_EVENT_STATE_TYPE_UNSUPPORTED_PLATFORM;
|
||||
} else {
|
||||
state |= NS_EVENT_STATE_TYPE_UNSUPPORTED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ePluginOutdated:
|
||||
case ePluginOtherState:
|
||||
// Do nothing, but avoid a compile warning
|
||||
|
@ -246,6 +246,8 @@ private:
|
||||
#define NS_EVENT_STATE_VULNERABLE_UPDATABLE NS_DEFINE_EVENT_STATE_MACRO(40)
|
||||
// Handler for click to play plugin (vulnerable w/no update)
|
||||
#define NS_EVENT_STATE_VULNERABLE_NO_UPDATE NS_DEFINE_EVENT_STATE_MACRO(41)
|
||||
// Platform does not support plugin content (some mobile platforms)
|
||||
#define NS_EVENT_STATE_TYPE_UNSUPPORTED_PLATFORM NS_DEFINE_EVENT_STATE_MACRO(42)
|
||||
|
||||
/**
|
||||
* NOTE: do not go over 63 without updating nsEventStates::InternalType!
|
||||
|
@ -127,6 +127,8 @@ CSS_STATE_PSEUDO_CLASS(mozSuppressed, ":-moz-suppressed",
|
||||
CSS_STATE_PSEUDO_CLASS(mozLoading, ":-moz-loading", NS_EVENT_STATE_LOADING)
|
||||
CSS_STATE_PSEUDO_CLASS(mozTypeUnsupported, ":-moz-type-unsupported",
|
||||
NS_EVENT_STATE_TYPE_UNSUPPORTED)
|
||||
CSS_STATE_PSEUDO_CLASS(mozTypeUnsupportedPlatform, ":-moz-type-unsupported-platform",
|
||||
NS_EVENT_STATE_TYPE_UNSUPPORTED_PLATFORM)
|
||||
CSS_STATE_PSEUDO_CLASS(mozHandlerClickToPlay, ":-moz-handler-clicktoplay",
|
||||
NS_EVENT_STATE_TYPE_CLICK_TO_PLAY)
|
||||
CSS_STATE_PSEUDO_CLASS(mozHandlerVulnerableUpdatable, ":-moz-handler-vulnerable-updatable",
|
||||
|
@ -188,6 +188,7 @@ abstract public class GeckoApp
|
||||
private static final String TYPE_NATIVE = "native";
|
||||
public ArrayList<PackageInfo> mPackageInfoCache = new ArrayList<PackageInfo>();
|
||||
|
||||
// Returns null if plugins are blocked on the device.
|
||||
String[] getPluginDirectories() {
|
||||
|
||||
// An awful hack to detect Tegra devices. Easiest way to do it without spinning up a EGL context.
|
||||
@ -196,7 +197,7 @@ abstract public class GeckoApp
|
||||
// disable Flash on pre-HC Tegra (bug 703056)
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
|
||||
Log.w(LOGTAG, "Blocking plugins because of Tegra 2 + Gingerbread bug (bug 703056)");
|
||||
return new String[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
// disable Flash on Tegra ICS with CM9 and other custom firmware (bug 736421)
|
||||
@ -211,7 +212,7 @@ abstract public class GeckoApp
|
||||
version.indexOf("Nova") != -1)
|
||||
{
|
||||
Log.w(LOGTAG, "Blocking plugins because of Tegra 2 + unofficial ICS bug (bug 736421)");
|
||||
return new String[0];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
|
@ -314,6 +314,13 @@ public class GeckoAppShell
|
||||
// setup plugin path directories
|
||||
try {
|
||||
String[] dirs = context.getPluginDirectories();
|
||||
// Check to see if plugins were blocked.
|
||||
if (dirs == null) {
|
||||
GeckoAppShell.putenv("MOZ_PLUGINS_BLOCKED=1");
|
||||
GeckoAppShell.putenv("MOZ_PLUGIN_PATH=");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuffer pluginSearchPath = new StringBuffer();
|
||||
for (int i = 0; i < dirs.length; i++) {
|
||||
Log.i(LOGTAG, "dir: " + dirs[i]);
|
||||
|
@ -21,6 +21,8 @@
|
||||
<!ENTITY pluginWizard.finalPage.restart.label "&brandShortName; needs to be restarted for the plugin(s) to work.">
|
||||
|
||||
<!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.">
|
||||
|
@ -8,7 +8,10 @@
|
||||
override the default Mozilla plugin finder service with their own mechanism. */
|
||||
embed:-moz-type-unsupported,
|
||||
applet:-moz-type-unsupported,
|
||||
object:-moz-has-handlerref:-moz-type-unsupported {
|
||||
object:-moz-has-handlerref:-moz-type-unsupported,
|
||||
embed:-moz-type-unsupported-platform,
|
||||
applet:-moz-type-unsupported-platform,
|
||||
object:-moz-has-handlerref:-moz-type-unsupported-platform {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
-moz-binding: url('chrome://mozapps/content/plugins/pluginProblem.xml#pluginProblem') !important;
|
||||
|
@ -24,6 +24,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 msgTapToPlay">&tapToPlayPlugin;</html:div>
|
||||
<html:div class="msg msgClickToPlay">&clickToPlayPlugin;</html:div>
|
||||
<html:div class="msg msgVulnerableUpdatable">&clickToPlayPluginVulnerableUpdateAvailable;</html:div>
|
||||
|
@ -17,6 +17,7 @@ html|applet:not([height]), html|applet[height=""] {
|
||||
}
|
||||
|
||||
:-moz-type-unsupported .mainBox,
|
||||
:-moz-type-unsupported-platform .mainBox,
|
||||
:-moz-handler-clicktoplay .mainBox,
|
||||
:-moz-handler-vulnerable-updatable .mainBox,
|
||||
:-moz-handler-vulnerable-no-update .mainBox,
|
||||
@ -25,6 +26,7 @@ html|applet:not([height]), html|applet[height=""] {
|
||||
-moz-user-focus: normal;
|
||||
}
|
||||
:-moz-type-unsupported .mainBox:focus,
|
||||
:-moz-type-unsupported-platform .mainBox:focus,
|
||||
:-moz-handler-clicktoplay .mainBox:focus,
|
||||
:-moz-handler-vulnerable-updatable .mainBox:focus,
|
||||
:-moz-handler-vulnerable-no-update .mainBox:focus,
|
||||
@ -50,6 +52,7 @@ html|applet:not([height]), html|applet[height=""] {
|
||||
}
|
||||
|
||||
:-moz-type-unsupported .msgUnsupported,
|
||||
:-moz-type-unsupported-platform .msgUnsupportedPlatform,
|
||||
:-moz-handler-clicktoplay .msgClickToPlay,
|
||||
:-moz-handler-vulnerable-updatable .msgVulnerableUpdatable,
|
||||
:-moz-handler-vulnerable-updatable .msgCheckForUpdates,
|
||||
|
@ -32,7 +32,8 @@ html|a {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
:-moz-type-unsupported .icon {
|
||||
:-moz-type-unsupported .icon,
|
||||
:-moz-type-unsupported-platform .icon {
|
||||
background-image: url(chrome://mozapps/skin/plugins/contentPluginMissing.png);
|
||||
}
|
||||
:-moz-type-unsupported .icon[status="ready"] {
|
||||
|
Loading…
Reference in New Issue
Block a user