summaryrefslogtreecommitdiffstats
path: root/ui/app_list
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 03:55:38 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 03:55:38 +0000
commitc19c953d175ab92aa790227ae007188c73986134 (patch)
tree8790c7bea1727a679f83f34ba38188bb781f4bfd /ui/app_list
parent9ecad220ad03c147c0f75c3d167614eeffa7d0b2 (diff)
downloadchromium_src-c19c953d175ab92aa790227ae007188c73986134.zip
chromium_src-c19c953d175ab92aa790227ae007188c73986134.tar.gz
chromium_src-c19c953d175ab92aa790227ae007188c73986134.tar.bz2
Initialize ScrollEvent offsets for ET_SCROLL_FLING_CANCEL
And app list should not process ET_SCROLL_FLING_CANCEL in its scroll event handler. BUG=162125 TEST=Verify no unexpected scrolling in app list. R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11419214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list')
-rw-r--r--ui/app_list/contents_view.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/ui/app_list/contents_view.cc b/ui/app_list/contents_view.cc
index f5e7030..076dd1f 100644
--- a/ui/app_list/contents_view.cc
+++ b/ui/app_list/contents_view.cc
@@ -220,18 +220,17 @@ ui::EventResult ContentsView::OnGestureEvent(ui::GestureEvent* event) {
}
ui::EventResult ContentsView::OnScrollEvent(ui::ScrollEvent* event) {
- if (show_state_ != SHOW_APPS)
+ if (show_state_ != SHOW_APPS ||
+ event->type() == ui::ET_SCROLL_FLING_CANCEL ||
+ abs(event->x_offset()) < kMinScrollToSwitchPage) {
return ui::ER_UNHANDLED;
-
- if (abs(event->x_offset()) > kMinScrollToSwitchPage) {
- if (!pagination_model_->has_transition()) {
- pagination_model_->SelectPageRelative(event->x_offset() > 0 ? -1 : 1,
- true);
- }
- return ui::ER_HANDLED;
}
- return ui::ER_UNHANDLED;
+ if (!pagination_model_->has_transition()) {
+ pagination_model_->SelectPageRelative(event->x_offset() > 0 ? -1 : 1,
+ true);
+ }
+ return ui::ER_HANDLED;
}
} // namespace app_list