Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4262)

Unified Diff: chrome/renderer/plugins/missing_plugin.cc

Issue 8851007: WIP / Do not commit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/plugins/missing_plugin.h ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/plugins/missing_plugin.cc
diff --git a/chrome/renderer/plugins/missing_plugin.cc b/chrome/renderer/plugins/missing_plugin.cc
index 07da5d10b7d5af0c9d977ef315f1458ceb8e2ca1..219cf70b6c7bd23af29ed8ff0a35ecfa459ee5d6 100644
--- a/chrome/renderer/plugins/missing_plugin.cc
+++ b/chrome/renderer/plugins/missing_plugin.cc
@@ -98,7 +98,7 @@ void MissingPlugin::HideCallback(const CppArgumentList& args,
void MissingPlugin::ShowContextMenu(const WebKit::WebMouseEvent& event) {
WebContextMenuData menu_data;
- WebVector<WebMenuItemInfo> custom_items(static_cast<size_t>(3));
+ WebVector<WebMenuItemInfo> custom_items(static_cast<size_t>(4));
size_t i = 0;
WebMenuItemInfo mime_type_item;
@@ -120,6 +120,15 @@ void MissingPlugin::ShowContextMenu(const WebKit::WebMouseEvent& event) {
hide_item.textDirection = WebKit::WebTextDirectionDefault;
custom_items[i++] = hide_item;
+ WebMenuItemInfo install_item;
+ install_item.action = chrome::MENU_COMMAND_PLUGIN_INSTALL;
+ install_item.enabled = false;
+ install_item.label = WebString::fromUTF8(
+ l10n_util::GetStringUTF8(IDS_CONTENT_CONTEXT_PLUGIN_INSTALL).c_str());
+ install_item.hasTextDirectionOverride = false;
+ install_item.textDirection = WebKit::WebTextDirectionDefault;
+ custom_items[i++] = install_item;
+
menu_data.customItems.swap(custom_items);
menu_data.mousePosition = WebPoint(event.windowX, event.windowY);
render_view()->ShowContextMenu(NULL, menu_data);
@@ -133,6 +142,10 @@ bool MissingPlugin::OnMessageReceived(const IPC::Message& message) {
OnFoundMissingPlugin)
IPC_MESSAGE_HANDLER(ChromeViewMsg_DidNotFindMissingPlugin,
OnDidNotFindMissingPlugin)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_StartedDownloadingPlugin,
+ OnStartedDownloadingPlugin)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_FinishedDownloadingPlugin,
+ OnFinishedDownloadingPlugin)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -147,6 +160,14 @@ void MissingPlugin::OnDidNotFindMissingPlugin() {
SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_FOUND));
}
+void MissingPlugin::OnStartedDownloadingPlugin() {
+ SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_DOWNLOADING));
+}
+
+void MissingPlugin::OnFinishedDownloadingPlugin() {
+ SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_INSTALLING));
+}
+
void MissingPlugin::SetMessage(const string16& message) {
message_ = message;
if (!plugin()->web_view()->mainFrame()->isLoading())
« no previous file with comments | « chrome/renderer/plugins/missing_plugin.h ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698