diff options
Diffstat (limited to 'ui/views/controls')
-rw-r--r-- | ui/views/controls/combobox/native_combobox_views.cc | 10 | ||||
-rw-r--r-- | ui/views/controls/combobox/native_combobox_views.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/ui/views/controls/combobox/native_combobox_views.cc b/ui/views/controls/combobox/native_combobox_views.cc index fa5ee44..e0032c3 100644 --- a/ui/views/controls/combobox/native_combobox_views.cc +++ b/ui/views/controls/combobox/native_combobox_views.cc @@ -85,6 +85,16 @@ bool NativeComboboxViews::OnMouseDragged(const views::MouseEvent& mouse_event) { return true; } +ui::GestureStatus NativeComboboxViews::OnGestureEvent( + const views::GestureEvent& gesture_event) { + if (gesture_event.type() == ui::ET_GESTURE_TAP) { + UpdateFromModel(); + ShowDropDownMenu(); + return ui::GESTURE_STATUS_CONSUMED; + } + return View::OnGestureEvent(gesture_event); +} + bool NativeComboboxViews::OnKeyPressed(const views::KeyEvent& key_event) { // TODO(oshima): handle IME. DCHECK_EQ(key_event.type(), ui::ET_KEY_PRESSED); diff --git a/ui/views/controls/combobox/native_combobox_views.h b/ui/views/controls/combobox/native_combobox_views.h index 145599e..83f1402 100644 --- a/ui/views/controls/combobox/native_combobox_views.h +++ b/ui/views/controls/combobox/native_combobox_views.h @@ -34,6 +34,8 @@ class NativeComboboxViews : public views::View, // views::View overrides: virtual bool OnMousePressed(const views::MouseEvent& mouse_event) OVERRIDE; virtual bool OnMouseDragged(const views::MouseEvent& mouse_event) OVERRIDE; + virtual ui::GestureStatus OnGestureEvent( + const views::GestureEvent& gesture_event) OVERRIDE; virtual bool OnKeyPressed(const views::KeyEvent& key_event) OVERRIDE; virtual bool OnKeyReleased(const views::KeyEvent& key_event) OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |