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

Unified Diff: ui/views/controls/scrollbar/base_scroll_bar.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/scrollbar/base_scroll_bar.h ('k') | ui/views/controls/scrollbar/native_scroll_bar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scrollbar/base_scroll_bar.cc
diff --git a/ui/views/controls/scrollbar/base_scroll_bar.cc b/ui/views/controls/scrollbar/base_scroll_bar.cc
index 833ac7983e9295e27318225aa91728e4351d15ed..6643735b5ce83fab6b67059c8b90d69cef4b9845 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/base_scroll_bar.cc
@@ -172,7 +172,7 @@ bool BaseScrollBar::OnMouseWheel(const ui::MouseWheelEvent& event) {
return true;
}
-ui::EventResult BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) {
+void BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) {
// If a fling is in progress, then stop the fling for any incoming gesture
// event (except for the GESTURE_END event that is generated at the end of the
// fling).
@@ -184,13 +184,14 @@ ui::EventResult BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
ProcessPressEvent(*event);
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
}
if (event->type() == ui::ET_GESTURE_LONG_PRESS) {
// For a long-press, the repeater started in tap-down should continue. So
// return early.
- return ui::ER_UNHANDLED;
+ return;
}
ResetState();
@@ -198,17 +199,21 @@ ui::EventResult BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP) {
// TAP_DOWN would have already scrolled some amount. So scrolling again on
// TAP is not necessary.
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
}
if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
- event->type() == ui::ET_GESTURE_SCROLL_END)
- return ui::ER_CONSUMED;
+ event->type() == ui::ET_GESTURE_SCROLL_END) {
+ event->SetHandled();
+ return;
+ }
if (event->type() == ui::ET_GESTURE_SCROLL_UPDATE) {
ScrollByContentsOffset(IsHorizontal() ? event->details().scroll_x() :
event->details().scroll_y());
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
}
if (event->type() == ui::ET_SCROLL_FLING_START) {
@@ -217,10 +222,8 @@ ui::EventResult BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) {
scroll_animator_->Start(
IsHorizontal() ? event->details().velocity_x() : 0.f,
IsHorizontal() ? 0.f : event->details().velocity_y());
- return ui::ER_CONSUMED;
+ event->SetHandled();
}
-
- return ui::ER_UNHANDLED;
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar.h ('k') | ui/views/controls/scrollbar/native_scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698