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

Unified Diff: ui/views/controls/combobox/native_combobox_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
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views.h ('k') | ui/views/controls/menu/menu_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/native_combobox_views.cc
diff --git a/ui/views/controls/combobox/native_combobox_views.cc b/ui/views/controls/combobox/native_combobox_views.cc
index 791598b7cbcdd22b5f40ead486c2b6861d6b3f0c..8ef1efa3102e649c8f7b184fc784f2228568abff 100644
--- a/ui/views/controls/combobox/native_combobox_views.cc
+++ b/ui/views/controls/combobox/native_combobox_views.cc
@@ -99,7 +99,7 @@ bool NativeComboboxViews::OnMousePressed(const ui::MouseEvent& mouse_event) {
combobox_->RequestFocus();
if (mouse_event.IsLeftMouseButton()) {
UpdateFromModel();
- ShowDropDownMenu();
+ ShowDropDownMenu(ui::MENU_SOURCE_MOUSE);
}
return true;
@@ -181,7 +181,7 @@ void NativeComboboxViews::OnBlur() {
void NativeComboboxViews::OnGestureEvent(ui::GestureEvent* gesture) {
if (gesture->type() == ui::ET_GESTURE_TAP) {
UpdateFromModel();
- ShowDropDownMenu();
+ ShowDropDownMenu(ui::MENU_SOURCE_TOUCH);
gesture->StopPropagation();
return;
}
@@ -368,7 +368,7 @@ void NativeComboboxViews::PaintText(gfx::Canvas* canvas) {
canvas->Restore();
}
-void NativeComboboxViews::ShowDropDownMenu() {
+void NativeComboboxViews::ShowDropDownMenu(ui::MenuSourceType source_type) {
if (!dropdown_list_menu_runner_.get())
UpdateFromModel();
@@ -397,7 +397,8 @@ void NativeComboboxViews::ShowDropDownMenu() {
dropdown_open_ = true;
if (dropdown_list_menu_runner_->RunMenuAt(
GetWidget(), NULL, bounds, MenuItemView::TOPLEFT,
- MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED)
+ source_type, MenuRunner::HAS_MNEMONICS) ==
+ MenuRunner::MENU_DELETED)
return;
dropdown_open_ = false;
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views.h ('k') | ui/views/controls/menu/menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698