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

Unified Diff: ui/views/controls/slide_out_view.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/slide_out_view.h ('k') | ui/views/controls/slider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/slide_out_view.cc
diff --git a/ui/views/controls/slide_out_view.cc b/ui/views/controls/slide_out_view.cc
index 058421d614cc12a41bfbe81fc0e8c72f9d01343e..2ecf3cda6bc0b182cb5364872211b1fd3dbe8bfc 100644
--- a/ui/views/controls/slide_out_view.cc
+++ b/ui/views/controls/slide_out_view.cc
@@ -19,7 +19,7 @@ SlideOutView::SlideOutView()
SlideOutView::~SlideOutView() {
}
-ui::EventResult SlideOutView::OnGestureEvent(ui::GestureEvent* event) {
+void SlideOutView::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_SCROLL_FLING_START) {
// The threshold for the fling velocity is computed empirically.
// The unit is in pixels/second.
@@ -27,14 +27,15 @@ ui::EventResult SlideOutView::OnGestureEvent(ui::GestureEvent* event) {
if (fabsf(event->details().velocity_x()) > kFlingThresholdForClose) {
SlideOutAndClose(event->details().velocity_x() < 0 ? SLIDE_LEFT :
SLIDE_RIGHT);
- return ui::ER_CONSUMED;
+ event->StopPropagation();
+ return;
}
RestoreVisualState();
- return ui::ER_UNHANDLED;
+ return;
}
if (!event->IsScrollGestureEvent())
- return ui::ER_UNHANDLED;
+ return;
if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN) {
gesture_scroll_amount_ = 0.f;
@@ -52,12 +53,13 @@ ui::EventResult SlideOutView::OnGestureEvent(ui::GestureEvent* event) {
float scrolled_ratio = fabsf(gesture_scroll_amount_) / width();
if (scrolled_ratio >= kScrollRatioForClosingNotification) {
SlideOutAndClose(gesture_scroll_amount_ < 0 ? SLIDE_LEFT : SLIDE_RIGHT);
- return ui::ER_CONSUMED;
+ event->StopPropagation();
+ return;
}
RestoreVisualState();
}
- return ui::ER_HANDLED;
+ event->SetHandled();
}
void SlideOutView::RestoreVisualState() {
« no previous file with comments | « ui/views/controls/slide_out_view.h ('k') | ui/views/controls/slider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698