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

Side by Side Diff: ui/app_list/pagination_model.h

Issue 316393002: App list uses PaginationModel to transition between pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 6 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 | Annotate | Revision Log
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_PAGINATION_MODEL_H_ 5 #ifndef UI_APP_LIST_PAGINATION_MODEL_H_
6 #define UI_APP_LIST_PAGINATION_MODEL_H_ 6 #define UI_APP_LIST_PAGINATION_MODEL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 const Transition& transition() const { return transition_; } 86 const Transition& transition() const { return transition_; }
87 87
88 bool is_valid_page(int page) const { 88 bool is_valid_page(int page) const {
89 return page >= 0 && page < total_pages_; 89 return page >= 0 && page < total_pages_;
90 } 90 }
91 91
92 bool has_transition() const { 92 bool has_transition() const {
93 return transition_.target_page != -1 || transition_.progress != 0; 93 return transition_.target_page != -1 || transition_.progress != 0;
94 } 94 }
95 95
96 // Gets the page that the animation will eventually land on. If there is no
97 // active animation, just returns selected_page().
98 int SelectedTargetPage() const;
99
96 private: 100 private:
97 void NotifySelectedPageChanged(int old_selected, int new_selected); 101 void NotifySelectedPageChanged(int old_selected, int new_selected);
98 void NotifyTransitionStarted(); 102 void NotifyTransitionStarted();
99 void NotifyTransitionChanged(); 103 void NotifyTransitionChanged();
100 104
101 void clear_transition() { 105 void clear_transition() {
102 SetTransition(Transition(-1, 0)); 106 SetTransition(Transition(-1, 0));
103 } 107 }
104 108
105 // Calculates a target page number by combining current page and |delta|. 109 // Calculates a target page number by combining current page and |delta|.
(...skipping 29 matching lines...) Expand all
135 base::TimeTicks last_overscroll_animation_start_time_; 139 base::TimeTicks last_overscroll_animation_start_time_;
136 140
137 ObserverList<PaginationModelObserver> observers_; 141 ObserverList<PaginationModelObserver> observers_;
138 142
139 DISALLOW_COPY_AND_ASSIGN(PaginationModel); 143 DISALLOW_COPY_AND_ASSIGN(PaginationModel);
140 }; 144 };
141 145
142 } // namespace app_list 146 } // namespace app_list
143 147
144 #endif // UI_APP_LIST_PAGINATION_MODEL_H_ 148 #endif // UI_APP_LIST_PAGINATION_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/pagination_model.cc » ('j') | ui/app_list/views/app_list_view_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698