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

Unified Diff: ui/app_list/contents_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/app_list/contents_view.h ('k') | ui/aura/demo/demo_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/contents_view.cc
diff --git a/ui/app_list/contents_view.cc b/ui/app_list/contents_view.cc
index 076dd1f0ffe64d6d90ab80572474ad66734921f4..fbbb1b1ec6aeedf146880fa6383000e710f4a364 100644
--- a/ui/app_list/contents_view.cc
+++ b/ui/app_list/contents_view.cc
@@ -185,24 +185,27 @@ bool ContentsView::OnMouseWheel(const ui::MouseWheelEvent& event) {
return false;
}
-ui::EventResult ContentsView::OnGestureEvent(ui::GestureEvent* event) {
+void ContentsView::OnGestureEvent(ui::GestureEvent* event) {
if (show_state_ != SHOW_APPS)
- return ui::ER_UNHANDLED;
+ return;
switch (event->type()) {
case ui::ET_GESTURE_SCROLL_BEGIN:
pagination_model_->StartScroll();
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
case ui::ET_GESTURE_SCROLL_UPDATE:
// event->details.scroll_x() > 0 means moving contents to right. That is,
// transitioning to previous page.
pagination_model_->UpdateScroll(
event->details().scroll_x() / GetContentsBounds().width());
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
case ui::ET_GESTURE_SCROLL_END:
pagination_model_->EndScroll(pagination_model_->
transition().progress < kFinishTransitionThreshold);
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
case ui::ET_SCROLL_FLING_START: {
pagination_model_->EndScroll(true);
if (fabs(event->details().velocity_x()) > kMinHorizVelocityToSwitchPage) {
@@ -210,13 +213,12 @@ ui::EventResult ContentsView::OnGestureEvent(ui::GestureEvent* event) {
event->details().velocity_x() < 0 ? 1 : -1,
true);
}
- return ui::ER_CONSUMED;
+ event->SetHandled();
+ return;
}
default:
break;
}
-
- return ui::ER_UNHANDLED;
}
ui::EventResult ContentsView::OnScrollEvent(ui::ScrollEvent* event) {
« no previous file with comments | « ui/app_list/contents_view.h ('k') | ui/aura/demo/demo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698