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

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

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 6 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
Index: chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc
diff --git a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc
index 158f2ada0b03bfa8e9c4d502e9263266d8f69b7e..1bfa3c406e75fbb67dc022a0f4e9b67720a1b6db 100644
--- a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc
+++ b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc
@@ -47,8 +47,25 @@ void RenderViewContextMenuViews::RunMenuAt(
views::MenuItemView::AnchorPosition anchor_position =
type == content::CONTEXT_MENU_SOURCE_TOUCH ?
views::MenuItemView::BOTTOMCENTER : views::MenuItemView::TOPLEFT;
+
+ // TODO(varunjain): remove this by consolidating ui::MenuSourceType and
+ // content::ContextMenuSourceType.
+ ui::MenuSourceType source_type = ui::MENU_SOURCE_NONE;
+ switch (type) {
+ case content::CONTEXT_MENU_SOURCE_MOUSE:
+ source_type = ui::MENU_SOURCE_MOUSE;
+ break;
+ case content::CONTEXT_MENU_SOURCE_KEYBOARD:
+ source_type = ui::MENU_SOURCE_KEYBOARD;
+ break;
+ case content::CONTEXT_MENU_SOURCE_TOUCH:
+ source_type = ui::MENU_SOURCE_TOUCH;
+ break;
+ default:
+ break;
+ }
if (menu_runner_->RunMenuAt(parent, NULL, gfx::Rect(point, gfx::Size()),
- anchor_position, views::MenuRunner::HAS_MNEMONICS |
+ anchor_position, source_type, views::MenuRunner::HAS_MNEMONICS |
views::MenuRunner::CONTEXT_MENU) ==
views::MenuRunner::MENU_DELETED)
return;
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_icon_win.cc ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698