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

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: add 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..acd5d2e087bd47c0b7845d1af3bc3471297f0342 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);
- }
+ // The drag zones are at the top and bottom of the experimental app list and
+ // on the sides and page switcher of the normal app list.
+ if (switches::IsExperimentalAppListEnabled()) {
Matt Giuca 2014/09/02 08:26:34 This should be: if (pagination_controller_->scrol
calamity 2014/09/03 11:25:36 Done.
+ if (drag_point.y() < kPageFlipZoneSize)
Matt Giuca 2014/09/02 08:26:34 I'm confused as to why this code is completely dif
Matt Giuca 2014/09/03 08:02:18 You explained this to me, so ignore it.
calamity 2014/09/03 11:25:36 Acknowledged.
+ 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