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

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

Issue 2716053002: [HBD] Add an Enable Flash context menu item for HBD placeholders. (Closed)
Patch Set: add comment Created 3 years, 9 months 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/custom_menu_commands.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/plugins/chrome_plugin_placeholder.cc
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
index c40e8e47dea5cee9aa67f0a231ab56c286af30b8..dce392ed27b6a83ee5d83b8b4daa83023b110e21 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -313,6 +313,10 @@ void ChromePluginPlaceholder::OnMenuAction(int request_id, unsigned action) {
HidePlugin();
break;
}
+ case chrome::MENU_COMMAND_ENABLE_FLASH: {
+ ShowPermissionBubbleCallback();
+ break;
+ }
default:
NOTREACHED();
}
@@ -345,7 +349,9 @@ void ChromePluginPlaceholder::ShowContextMenu(
params.custom_items.push_back(separator_item);
}
- if (!GetPluginInfo().path.value().empty()) {
+ bool flash_hidden =
+ status_ == ChromeViewHostMsg_GetPluginInfo_Status::kFlashHiddenPreferHtml;
+ if (!GetPluginInfo().path.value().empty() && !flash_hidden) {
content::MenuItem run_item;
run_item.action = chrome::MENU_COMMAND_PLUGIN_RUN;
// Disable this menu item if the plugin is blocked by policy.
@@ -354,6 +360,15 @@ void ChromePluginPlaceholder::ShowContextMenu(
params.custom_items.push_back(run_item);
}
+ if (flash_hidden) {
+ content::MenuItem enable_flash_item;
+ enable_flash_item.action = chrome::MENU_COMMAND_ENABLE_FLASH;
+ enable_flash_item.enabled = true;
+ enable_flash_item.label =
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_ENABLE_FLASH);
+ params.custom_items.push_back(enable_flash_item);
+ }
+
content::MenuItem hide_item;
hide_item.action = chrome::MENU_COMMAND_PLUGIN_HIDE;
bool is_main_frame_plugin_document =
« no previous file with comments | « chrome/renderer/custom_menu_commands.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698