Commit 6d9cba8d authored by newt@chromium.org's avatar newt@chromium.org

Add placeholder text for unsupported plug-ins.

On platforms that don't support installing plug-ins, show a "plug-in
unsupported" message instead of a "missing plug-in" message.

BUG=158871

Review URL: https://codereview.chromium.org/11414010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171021 0039d316-1c4b-4281-b951-d872f2087c98
parent 778a4025
...@@ -7188,7 +7188,7 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -7188,7 +7188,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_PLUGIN_UPDATE" desc="The link for updating an outdated plug-in."> <message name="IDS_PLUGIN_UPDATE" desc="The link for updating an outdated plug-in.">
Update plug-in... Update plug-in...
</message> </message>
<message name="IDS_PLUGIN_NOT_SUPPORTED" desc="The placeholder text for a plug-in that can't run in Windows Metro mode."> <message name="IDS_PLUGIN_NOT_SUPPORTED_METRO" desc="The placeholder text for a plug-in that can't run in Windows Metro mode.">
This plug-in only works on the desktop. This plug-in only works on the desktop.
</message> </message>
<message name="IDS_PLUGIN_BLOCKED" desc="The placeholder text for a blocked plug-in."> <message name="IDS_PLUGIN_BLOCKED" desc="The placeholder text for a blocked plug-in.">
...@@ -7203,6 +7203,9 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -7203,6 +7203,9 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_PLUGIN_NOT_AUTHORIZED" desc="The placeholder text for a plug-in that requires user permission to run."> <message name="IDS_PLUGIN_NOT_AUTHORIZED" desc="The placeholder text for a plug-in that requires user permission to run.">
<ph name="PLUGIN_NAME">$1<ex>Java</ex></ph> needs your permission to run. <ph name="PLUGIN_NAME">$1<ex>Java</ex></ph> needs your permission to run.
</message> </message>
<message name="IDS_PLUGIN_NOT_SUPPORTED" desc="The placeholder text for an unsupported plug-in.">
This plug-in is not supported.
</message>
<message name="IDS_PLUGIN_NOT_FOUND" desc="The placeholder text for an unknown plug-in that is not installed."> <message name="IDS_PLUGIN_NOT_FOUND" desc="The placeholder text for an unknown plug-in that is not installed.">
No plug-in available to display this content. No plug-in available to display this content.
</message> </message>
......
...@@ -550,7 +550,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( ...@@ -550,7 +550,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
placeholder = PluginPlaceholder::CreateBlockedPlugin( placeholder = PluginPlaceholder::CreateBlockedPlugin(
render_view, frame, params, plugin, identifier, group_name, render_view, frame, params, plugin, identifier, group_name,
IDR_BLOCKED_PLUGIN_HTML, IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED)); l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO));
render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( render_view->Send(new ChromeViewHostMsg_NPAPINotSupported(
render_view->GetRoutingID(), identifier)); render_view->GetRoutingID(), identifier));
break; break;
......
...@@ -109,7 +109,12 @@ PluginPlaceholder* PluginPlaceholder::CreateMissingPlugin( ...@@ -109,7 +109,12 @@ PluginPlaceholder* PluginPlaceholder::CreateMissingPlugin(
IDR_BLOCKED_PLUGIN_HTML)); IDR_BLOCKED_PLUGIN_HTML));
DictionaryValue values; DictionaryValue values;
#if defined(ENABLE_PLUGIN_INSTALLATION)
values.SetString("message", l10n_util::GetStringUTF8(IDS_PLUGIN_SEARCHING)); values.SetString("message", l10n_util::GetStringUTF8(IDS_PLUGIN_SEARCHING));
#else
values.SetString("message",
l10n_util::GetStringUTF8(IDS_PLUGIN_NOT_SUPPORTED));
#endif
std::string html_data = std::string html_data =
jstemplate_builder::GetI18nTemplateHtml(template_html, &values); jstemplate_builder::GetI18nTemplateHtml(template_html, &values);
...@@ -122,8 +127,6 @@ PluginPlaceholder* PluginPlaceholder::CreateMissingPlugin( ...@@ -122,8 +127,6 @@ PluginPlaceholder* PluginPlaceholder::CreateMissingPlugin(
RenderThread::Get()->Send(new ChromeViewHostMsg_FindMissingPlugin( RenderThread::Get()->Send(new ChromeViewHostMsg_FindMissingPlugin(
missing_plugin->routing_id(), missing_plugin->CreateRoutingId(), missing_plugin->routing_id(), missing_plugin->CreateRoutingId(),
params.mimeType.utf8())); params.mimeType.utf8()));
#else
missing_plugin->OnDidNotFindMissingPlugin();
#endif #endif
return missing_plugin; return missing_plugin;
} }
...@@ -407,11 +410,11 @@ void PluginPlaceholder::WillDestroyPlugin() { ...@@ -407,11 +410,11 @@ void PluginPlaceholder::WillDestroyPlugin() {
delete this; delete this;
} }
#if defined(ENABLE_PLUGIN_INSTALLATION)
void PluginPlaceholder::OnDidNotFindMissingPlugin() { void PluginPlaceholder::OnDidNotFindMissingPlugin() {
SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_FOUND)); SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_FOUND));
} }
#if defined(ENABLE_PLUGIN_INSTALLATION)
void PluginPlaceholder::OnFoundMissingPlugin(const string16& plugin_name) { void PluginPlaceholder::OnFoundMissingPlugin(const string16& plugin_name) {
if (status_->value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound) if (status_->value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound)
SetMessage(l10n_util::GetStringFUTF16(IDS_PLUGIN_FOUND, plugin_name)); SetMessage(l10n_util::GetStringFUTF16(IDS_PLUGIN_FOUND, plugin_name));
......
...@@ -135,8 +135,8 @@ class PluginPlaceholder : public content::RenderViewObserver, ...@@ -135,8 +135,8 @@ class PluginPlaceholder : public content::RenderViewObserver,
void OnLoadBlockedPlugins(const std::string& identifier); void OnLoadBlockedPlugins(const std::string& identifier);
void OnSetIsPrerendering(bool is_prerendering); void OnSetIsPrerendering(bool is_prerendering);
void OnDidNotFindMissingPlugin();
#if defined(ENABLE_PLUGIN_INSTALLATION) #if defined(ENABLE_PLUGIN_INSTALLATION)
void OnDidNotFindMissingPlugin();
void OnFoundMissingPlugin(const string16& plugin_name); void OnFoundMissingPlugin(const string16& plugin_name);
void OnStartedDownloadingPlugin(); void OnStartedDownloadingPlugin();
void OnFinishedDownloadingPlugin(); void OnFinishedDownloadingPlugin();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment