diff options
author | flackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-21 20:42:41 +0000 |
---|---|---|
committer | flackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-21 20:42:41 +0000 |
commit | 39d0839653c7d627a0eca602d5eec6f9dd415c51 (patch) | |
tree | a5bb85c5870a455ce19e781a68bf4ac35efac314 /ui/views/controls | |
parent | 56a5107804d263d258858af7c3905d3cd5c5957e (diff) | |
download | chromium_src-39d0839653c7d627a0eca602d5eec6f9dd415c51.zip chromium_src-39d0839653c7d627a0eca602d5eec6f9dd415c51.tar.gz chromium_src-39d0839653c7d627a0eca602d5eec6f9dd415c51.tar.bz2 |
Handle TAP gesture on views combo box.
BUG=131204
TEST=Open encrypted wifi dialog. Tap any of the combo boxes there and select an item.
Review URL: https://chromiumcodereview.appspot.com/10599005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143444 0039d316-1c4b-4281-b951-d872f2087c98
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; |