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

Unified Diff: ui/views/controls/textfield/native_textfield_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.h ('k') | ui/views/controls/tree/tree_view_views.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_views.cc
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc
index 5be141a325f950fd66f194ed5441d73aa4f55817..c3d489e6b11e1a329567c60d4f56eeb84a5964c7 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -143,10 +143,10 @@ void NativeTextfieldViews::OnMouseReleased(const ui::MouseEvent& event) {
OnAfterUserAction();
}
-ui::EventResult NativeTextfieldViews::OnGestureEvent(ui::GestureEvent* event) {
- ui::EventResult status = textfield_->OnGestureEvent(event);
- if (status != ui::ER_UNHANDLED)
- return status;
+void NativeTextfieldViews::OnGestureEvent(ui::GestureEvent* event) {
+ textfield_->OnGestureEvent(event);
+ if (event->handled())
+ return;
switch (event->type()) {
case ui::ET_GESTURE_TAP_DOWN:
@@ -158,20 +158,23 @@ ui::EventResult NativeTextfieldViews::OnGestureEvent(ui::GestureEvent* event) {
MoveCursorTo(event->location(), false))
SchedulePaint();
OnAfterUserAction();
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
case ui::ET_GESTURE_DOUBLE_TAP:
SelectAll(false);
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
case ui::ET_GESTURE_SCROLL_UPDATE:
OnBeforeUserAction();
if (MoveCursorTo(event->location(), true))
SchedulePaint();
OnAfterUserAction();
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
default:
break;
}
- return TouchSelectionClientView::OnGestureEvent(event);
+ TouchSelectionClientView::OnGestureEvent(event);
}
bool NativeTextfieldViews::OnKeyPressed(const ui::KeyEvent& event) {
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.h ('k') | ui/views/controls/tree/tree_view_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698