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

Unified Diff: ui/app_list/views/apps_grid_view.cc

Issue 518673008: Make page switch on drag happen at top and bottom for experimental app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares_remove_page_switcher
Patch Set: address comment Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/apps_grid_view.cc
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 9acafda03ed81728577f8b60b4562f3a0fdf151c..ec8f29a0a2ca2bcd7e08df7bb004704ed7fefee9 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -1652,22 +1652,30 @@ void AppsGridView::MaybeStartPageFlipTimer(const gfx::Point& drag_point) {
StopPageFlipTimer();
int new_page_flip_target = -1;
- if (page_switcher_view_ &&
- page_switcher_view_->bounds().Contains(drag_point)) {
- gfx::Point page_switcher_point(drag_point);
- views::View::ConvertPointToTarget(this, page_switcher_view_,
- &page_switcher_point);
- new_page_flip_target =
- page_switcher_view_->GetPageForPoint(page_switcher_point);
- }
+ // Drag zones are at the edges of the scroll axis.
+ if (pagination_controller_->scroll_axis() ==
+ PaginationController::SCROLL_AXIS_VERTICAL) {
+ if (drag_point.y() < kPageFlipZoneSize)
+ new_page_flip_target = pagination_model_.selected_page() - 1;
+ else if (drag_point.y() > height() - kPageFlipZoneSize)
+ new_page_flip_target = pagination_model_.selected_page() + 1;
+ } else {
+ if (page_switcher_view_->bounds().Contains(drag_point)) {
+ gfx::Point page_switcher_point(drag_point);
+ views::View::ConvertPointToTarget(
+ this, page_switcher_view_, &page_switcher_point);
+ new_page_flip_target =
+ page_switcher_view_->GetPageForPoint(page_switcher_point);
+ }
- // TODO(xiyuan): Fix this for RTL.
- if (new_page_flip_target == -1 && drag_point.x() < kPageFlipZoneSize)
- new_page_flip_target = pagination_model_.selected_page() - 1;
+ // TODO(xiyuan): Fix this for RTL.
+ if (new_page_flip_target == -1 && drag_point.x() < kPageFlipZoneSize)
+ new_page_flip_target = pagination_model_.selected_page() - 1;
- if (new_page_flip_target == -1 &&
- drag_point.x() > width() - kPageFlipZoneSize) {
- new_page_flip_target = pagination_model_.selected_page() + 1;
+ if (new_page_flip_target == -1 &&
+ drag_point.x() > width() - kPageFlipZoneSize) {
+ new_page_flip_target = pagination_model_.selected_page() + 1;
+ }
}
if (new_page_flip_target == page_flip_target_)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698