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