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

Unified Diff: ui/app_list/cocoa/apps_grid_controller.h

Issue 14999013: Allow pages on the OSX app launcher to be turned while dragging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests! Created 7 years, 7 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/cocoa/apps_grid_controller.h
diff --git a/ui/app_list/cocoa/apps_grid_controller.h b/ui/app_list/cocoa/apps_grid_controller.h
index 08529837c51ab7eea675876ec0b01cd7f2f3e994..4fb2d6e4fb2e32c3fff3dcd507bf702e4b5489de 100644
--- a/ui/app_list/cocoa/apps_grid_controller.h
+++ b/ui/app_list/cocoa/apps_grid_controller.h
@@ -35,11 +35,16 @@ APP_LIST_EXPORT
scoped_nsobject<AppsCollectionViewDragManager> dragManager_;
scoped_nsobject<NSMutableArray> pages_;
scoped_nsobject<NSMutableArray> items_;
+ scoped_nsobject<NSTimer> scrollWhileDraggingTimer_;
id<AppsPaginationModelObserver> paginationObserver_;
// Index of the currently visible page.
size_t visiblePage_;
+ // The page to which the view is currently animating a scroll.
+ size_t targetScrollPage_;
+ // The page to start scrolling to when the timer expires.
+ size_t scheduledScrollPage_;
// Whether we are currently animating a scroll to the nearest page.
BOOL animatingScroll_;
@@ -75,6 +80,14 @@ APP_LIST_EXPORT
// Scroll to a page in the grid view with an animation.
- (void)scrollToPage:(size_t)pageIndex;
+// Start a timer to scroll to a new page, if |locationInWindow| is to the left
+// or the right of the view, or if it is over a pager segment. Cancels any
+// existing timer if the target page changes.
+- (void)maybeChangePageForPoint:(NSPoint)locationInWindow;
+
+// Cancel a timer that may have been set by maybeChangePageForPoint().
+- (void)cancelScrollTimer;
+
// Moves an item within the view only, for dragging or in response to model
// changes.
- (void)moveItemInView:(size_t)fromIndex
@@ -101,6 +114,7 @@ APP_LIST_EXPORT
@interface AppsGridController(TestingAPI)
- (AppsCollectionViewDragManager*)dragManager;
+- (size_t)scheduledScrollPage;
@end

Powered by Google App Engine
This is Rietveld 408576698