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

Unified Diff: ui/views/controls/textfield/native_textfield_views.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (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: ui/views/controls/textfield/native_textfield_views.cc
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc
index f8ecb491e83456e96fd50e19b42ed7cd8ffb4fd8..3e78f1e7b374335b8a63ab27712548532f8f3860 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -427,7 +427,7 @@ bool NativeTextfieldViews::DrawsHandles() {
void NativeTextfieldViews::OpenContextMenu(const gfx::Point anchor) {
touch_selection_controller_.reset();
- ShowContextMenu(anchor, false);
+ ShowContextMenu(anchor, ui::CONTEXT_MENU_SOURCE_TOUCH_EDITING);
}
gfx::NativeCursor NativeTextfieldViews::GetCursor(const ui::MouseEvent& event) {
@@ -445,11 +445,13 @@ gfx::NativeCursor NativeTextfieldViews::GetCursor(const ui::MouseEvent& event) {
/////////////////////////////////////////////////////////////////
// NativeTextfieldViews, ContextMenuController overrides:
-void NativeTextfieldViews::ShowContextMenuForView(View* source,
- const gfx::Point& point) {
+void NativeTextfieldViews::ShowContextMenuForView(
+ View* source,
+ const gfx::Point& point,
+ ui::ContextMenuSourceType source_type) {
UpdateContextMenu();
- if (context_menu_runner_->RunMenuAt(GetWidget(), NULL,
- gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT,
+ if (context_menu_runner_->RunContextMenuAt(GetWidget(), NULL,
+ gfx::Rect(point, gfx::Size()), source_type,
MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) ==
MenuRunner::MENU_DELETED)
return;

Powered by Google App Engine
This is Rietveld 408576698