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

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

Issue 17432002: Replace content::ContextMenuSourceType with ui::MenuSourceType. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 70d6c7b6af1539b00ee1ce244747eccea072e121..3349064dbdcb76b26accd851258bc59cf8fc249b 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
@@ -40,33 +40,16 @@ RenderViewContextMenuViews* RenderViewContextMenuViews::Create(
}
#endif // OS_WIN
-void RenderViewContextMenuViews::RunMenuAt(
- views::Widget* parent,
- const gfx::Point& point,
- content::ContextMenuSourceType type) {
+void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent,
+ const gfx::Point& point,
+ ui::MenuSourceType type) {
views::MenuItemView::AnchorPosition anchor_position =
- (type == content::CONTEXT_MENU_SOURCE_TOUCH ||
- type == content::CONTEXT_MENU_SOURCE_TOUCH_EDIT_MENU) ?
+ (type == ui::MENU_SOURCE_TOUCH ||
+ type == ui::MENU_SOURCE_TOUCH_EDIT_MENU) ?
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, source_type, views::MenuRunner::HAS_MNEMONICS |
+ anchor_position, type, views::MenuRunner::HAS_MNEMONICS |
views::MenuRunner::CONTEXT_MENU) ==
views::MenuRunner::MENU_DELETED)
return;

Powered by Google App Engine
This is Rietveld 408576698