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

Side by Side Diff: ui/app_list/views/apps_grid_view.h

Issue 491973004: Make apps grid view scroll vertically in experimental app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@calamity-ares-vertical-scroll
Patch Set: Rename width to size. 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 unified diff | Download patch
« no previous file with comments | « ash/wm/app_list_controller.cc ('k') | ui/app_list/views/apps_grid_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_
6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 private: 218 private:
219 friend class test::AppsGridViewTestApi; 219 friend class test::AppsGridViewTestApi;
220 220
221 enum DropAttempt { 221 enum DropAttempt {
222 DROP_FOR_NONE, 222 DROP_FOR_NONE,
223 DROP_FOR_REORDER, 223 DROP_FOR_REORDER,
224 DROP_FOR_FOLDER, 224 DROP_FOR_FOLDER,
225 }; 225 };
226 226
227 enum ScrollAxis { SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_VERTICAL };
228
227 // Represents the index to an item view in the grid. 229 // Represents the index to an item view in the grid.
228 struct Index { 230 struct Index {
229 Index() : page(-1), slot(-1) {} 231 Index() : page(-1), slot(-1) {}
230 Index(int page, int slot) : page(page), slot(slot) {} 232 Index(int page, int slot) : page(page), slot(slot) {}
231 233
232 bool operator==(const Index& other) const { 234 bool operator==(const Index& other) const {
233 return page == other.page && slot == other.slot; 235 return page == other.page && slot == other.slot;
234 } 236 }
235 bool operator!=(const Index& other) const { 237 bool operator!=(const Index& other) const {
236 return page != other.page || slot != other.slot; 238 return page != other.page || slot != other.slot;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 bool IsUnderOEMFolder(); 454 bool IsUnderOEMFolder();
453 455
454 void StartSettingUpSynchronousDrag(); 456 void StartSettingUpSynchronousDrag();
455 bool RunSynchronousDrag(); 457 bool RunSynchronousDrag();
456 void CleanUpSynchronousDrag(); 458 void CleanUpSynchronousDrag();
457 #if defined(OS_WIN) 459 #if defined(OS_WIN)
458 void OnGotShortcutPath(scoped_refptr<SynchronousDrag> drag, 460 void OnGotShortcutPath(scoped_refptr<SynchronousDrag> drag,
459 const base::FilePath& path); 461 const base::FilePath& path);
460 #endif 462 #endif
461 463
464 // Determines whether the grid view scrolls horizontally or vertically.
465 static ScrollAxis GetScrollAxis();
466
462 AppListModel* model_; // Owned by AppListView. 467 AppListModel* model_; // Owned by AppListView.
463 AppListItemList* item_list_; // Not owned. 468 AppListItemList* item_list_; // Not owned.
464 AppsGridViewDelegate* delegate_; 469 AppsGridViewDelegate* delegate_;
465 470
466 // This can be NULL. Only grid views inside folders have a folder delegate. 471 // This can be NULL. Only grid views inside folders have a folder delegate.
467 AppsGridViewFolderDelegate* folder_delegate_; 472 AppsGridViewFolderDelegate* folder_delegate_;
468 473
469 PaginationModel pagination_model_; 474 PaginationModel pagination_model_;
470 PageSwitcher* page_switcher_view_; // Owned by views hierarchy. 475 PageSwitcher* page_switcher_view_; // Owned by views hierarchy.
471 476
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 556
552 // True if the drag_view_ item is a folder item being dragged for reparenting. 557 // True if the drag_view_ item is a folder item being dragged for reparenting.
553 bool dragging_for_reparent_item_; 558 bool dragging_for_reparent_item_;
554 559
555 DISALLOW_COPY_AND_ASSIGN(AppsGridView); 560 DISALLOW_COPY_AND_ASSIGN(AppsGridView);
556 }; 561 };
557 562
558 } // namespace app_list 563 } // namespace app_list
559 564
560 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ 565 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_
OLDNEW
« no previous file with comments | « ash/wm/app_list_controller.cc ('k') | ui/app_list/views/apps_grid_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698