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

Side by Side Diff: ui/views/controls/combobox/native_combobox_views.cc

Issue 11280290: events: Change gesture-event handler in EventHandler to not return any values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views.h ('k') | ui/views/controls/link.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/combobox/native_combobox_views.h" 5 #include "ui/views/controls/combobox/native_combobox_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "ui/base/events/event.h" 10 #include "ui/base/events/event.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 NOTREACHED(); 154 NOTREACHED();
155 } 155 }
156 156
157 void NativeComboboxViews::OnBlur() { 157 void NativeComboboxViews::OnBlur() {
158 NOTREACHED(); 158 NOTREACHED();
159 } 159 }
160 160
161 ///////////////////////////////////////////////////////////////// 161 /////////////////////////////////////////////////////////////////
162 // NativeComboboxViews, ui::EventHandler overrides: 162 // NativeComboboxViews, ui::EventHandler overrides:
163 163
164 ui::EventResult NativeComboboxViews::OnGestureEvent(ui::GestureEvent* gesture) { 164 void NativeComboboxViews::OnGestureEvent(ui::GestureEvent* gesture) {
165 if (gesture->type() == ui::ET_GESTURE_TAP) { 165 if (gesture->type() == ui::ET_GESTURE_TAP) {
166 UpdateFromModel(); 166 UpdateFromModel();
167 ShowDropDownMenu(); 167 ShowDropDownMenu();
168 return ui::ER_CONSUMED; 168 gesture->StopPropagation();
169 return;
169 } 170 }
170 return View::OnGestureEvent(gesture); 171 View::OnGestureEvent(gesture);
171 } 172 }
172 173
173 ///////////////////////////////////////////////////////////////// 174 /////////////////////////////////////////////////////////////////
174 // NativeComboboxViews, NativeComboboxWrapper overrides: 175 // NativeComboboxViews, NativeComboboxWrapper overrides:
175 176
176 void NativeComboboxViews::UpdateFromModel() { 177 void NativeComboboxViews::UpdateFromModel() {
177 int max_width = 0; 178 int max_width = 0;
178 const gfx::Font& font = Combobox::GetFont(); 179 const gfx::Font& font = Combobox::GetFont();
179 180
180 MenuItemView* menu = new MenuItemView(this); 181 MenuItemView* menu = new MenuItemView(this);
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 370
370 #if defined(USE_AURA) 371 #if defined(USE_AURA)
371 // static 372 // static
372 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( 373 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper(
373 Combobox* combobox) { 374 Combobox* combobox) {
374 return new NativeComboboxViews(combobox); 375 return new NativeComboboxViews(combobox);
375 } 376 }
376 #endif 377 #endif
377 378
378 } // namespace views 379 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views.h ('k') | ui/views/controls/link.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698