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

Unified Diff: ui/app_list/pagination_controller.cc

Issue 2982453002: New AppListView Scroll Behavior. (Closed)
Patch Set: Addressed comments. Created 3 years, 5 months 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
Index: ui/app_list/pagination_controller.cc
diff --git a/ui/app_list/pagination_controller.cc b/ui/app_list/pagination_controller.cc
index b05357635d266765b7d00f1bd8a3985c40b19af9..654f15407bf3073c849c6c1f6b8711e637ea739c 100644
--- a/ui/app_list/pagination_controller.cc
+++ b/ui/app_list/pagination_controller.cc
@@ -23,8 +23,7 @@ const double kFinishTransitionThreshold = 0.33;
PaginationController::PaginationController(PaginationModel* model,
ScrollAxis scroll_axis)
- : pagination_model_(model), scroll_axis_(scroll_axis) {
-}
+ : pagination_model_(model), scroll_axis_(scroll_axis) {}
bool PaginationController::OnScroll(const gfx::Vector2d& offset,
ScrollEventType type) {
@@ -42,11 +41,9 @@ bool PaginationController::OnScroll(const gfx::Vector2d& offset,
// Do not scroll on very small events.
// TODO(calamity): This should only apply on touchpad scroll but touchpad
// events are coming in as mousewheel events. See https://crbug.com/594264.
- if (abs(offset_magnitude) > kMinScrollToSwitchPage) {
- if (!pagination_model_->has_transition()) {
- pagination_model_->SelectPageRelative(offset_magnitude > 0 ? -1 : 1,
- true);
- }
+ if (abs(offset_magnitude) > kMinScrollToSwitchPage &&
khmel 2017/07/14 18:10:01 nit: I would not do just only style fix and prefer
newcomer 2017/07/17 21:38:10 I actually am fixing a bug here (returning true in
+ !pagination_model_->has_transition()) {
+ pagination_model_->SelectPageRelative(offset_magnitude > 0 ? -1 : 1, true);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698