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

Unified Diff: ui/views/controls/textfield/native_textfield_win.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/controls/textfield/native_textfield_views.cc ('k') | ui/views/controls/tree/tree_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/native_textfield_win.cc
diff --git a/ui/views/controls/textfield/native_textfield_win.cc b/ui/views/controls/textfield/native_textfield_win.cc
index 5dae06fc983fcb337ecc40f81760550a9ff0fb1b..8866cfe08f658f4040b5ff642b8f6c6a57d5acb1 100644
--- a/ui/views/controls/textfield/native_textfield_win.cc
+++ b/ui/views/controls/textfield/native_textfield_win.cc
@@ -613,7 +613,9 @@ void NativeTextfieldWin::OnChar(TCHAR ch, UINT repeat_count, UINT flags) {
void NativeTextfieldWin::OnContextMenu(HWND window, const POINT& point) {
POINT p(point);
+ ui::MenuSourceType source_type = ui::MENU_SOURCE_MOUSE;
if (point.x == -1 || point.y == -1) {
+ source_type = ui::MENU_SOURCE_KEYBOARD;
GetCaretPos(&p);
MapWindowPoints(HWND_DESKTOP, &p, 1);
}
@@ -624,7 +626,7 @@ void NativeTextfieldWin::OnContextMenu(HWND window, const POINT& point) {
ignore_result(context_menu_runner_->RunMenuAt(textfield_->GetWidget(), NULL,
gfx::Rect(gfx::Point(p), gfx::Size()), MenuItemView::TOPLEFT,
- MenuRunner::HAS_MNEMONICS));
+ source_type, MenuRunner::HAS_MNEMONICS));
}
void NativeTextfieldWin::OnCopy() {
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.cc ('k') | ui/views/controls/tree/tree_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698