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

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

Issue 937823002: Plugin Placeholders: Fix "blank first menu item" bug when no mime type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | 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 dcbeca824b97e8fe0a6d8fea38670d7a20bfd921..375c3da5e934246d9157761de07e99cb7c93cd51 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -331,13 +331,15 @@ void ChromePluginPlaceholder::ShowContextMenu(const WebMouseEvent& event) {
content::ContextMenuParams params;
- content::MenuItem name_item;
- name_item.label = title_;
- params.custom_items.push_back(name_item);
-
- content::MenuItem separator_item;
- separator_item.type = content::MenuItem::SEPARATOR;
- params.custom_items.push_back(separator_item);
+ if (!title_.empty()) {
+ content::MenuItem name_item;
+ name_item.label = title_;
+ params.custom_items.push_back(name_item);
+
+ content::MenuItem separator_item;
+ separator_item.type = content::MenuItem::SEPARATOR;
+ params.custom_items.push_back(separator_item);
+ }
if (!GetPluginInfo().path.value().empty()) {
content::MenuItem run_item;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698