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

Unified Diff: chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc

Issue 8834008: Hide default context menu for platform apps. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Compile on non-Windows OS 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
Index: chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
index 2ae15357cc35a22eec83a36776f33e05d12c7003..36f50716560062b55574916f93fc1f774ad5e4de 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
@@ -341,6 +341,10 @@ void TabContentsViewViews::ShowContextMenu(const ContextMenuParams& params) {
context_menu_.reset(new RenderViewContextMenuViews(tab_contents_, params));
context_menu_->Init();
+ // Don't show empty menus.
+ if (context_menu_->menu_model().GetItemCount() == 0)
+ return;
+
gfx::Point screen_point(params.x, params.y);
views::View::ConvertPointToScreen(GetRootView(), &screen_point);

Powered by Google App Engine
This is Rietveld 408576698