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

Unified Diff: ui/views/view.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
« no previous file with comments | « ui/views/view.h ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index d897859c985e87310e24355ddf28f587f283cb88..637fcf8d41c406422e4da74253f0314763e989ea 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -137,7 +137,7 @@ class PostEventDispatchHandler : public ui::EventHandler {
event->type() == ui::ET_GESTURE_TWO_FINGER_TAP)) {
gfx::Point location(event->location());
View::ConvertPointToScreen(owner_, &location);
- owner_->ShowContextMenu(location, true);
+ owner_->ShowContextMenu(location, ui::MENU_SOURCE_TOUCH);
event->StopPropagation();
}
}
@@ -1148,11 +1148,12 @@ bool View::GetTooltipTextOrigin(const gfx::Point& p, gfx::Point* loc) const {
// Context menus ---------------------------------------------------------------
-void View::ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture) {
+void View::ShowContextMenu(const gfx::Point& p,
+ ui::MenuSourceType source_type) {
if (!context_menu_controller_)
return;
- context_menu_controller_->ShowContextMenuForView(this, p);
+ context_menu_controller_->ShowContextMenuForView(this, p, source_type);
}
// static
@@ -2117,7 +2118,7 @@ bool View::ProcessMousePressed(const ui::MouseEvent& event) {
gfx::Point location(event.location());
if (HitTestPoint(location)) {
ConvertPointToScreen(this, &location);
- ShowContextMenu(location, true);
+ ShowContextMenu(location, ui::MENU_SOURCE_MOUSE);
return true;
}
}
@@ -2160,7 +2161,7 @@ void View::ProcessMouseReleased(const ui::MouseEvent& event) {
OnMouseReleased(event);
if (HitTestPoint(location)) {
ConvertPointToScreen(this, &location);
- ShowContextMenu(location, true);
+ ShowContextMenu(location, ui::MENU_SOURCE_MOUSE);
}
} else {
OnMouseReleased(event);
« no previous file with comments | « ui/views/view.h ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698