OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CONTENTS_ANIMATOR_H_ | 5 #ifndef UI_APP_LIST_VIEWS_CONTENTS_ANIMATOR_H_ |
6 #define UI_APP_LIST_VIEWS_CONTENTS_ANIMATOR_H_ | 6 #define UI_APP_LIST_VIEWS_CONTENTS_ANIMATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Updates the state of the ContentsView. |progress| is the amount of progress | 33 // Updates the state of the ContentsView. |progress| is the amount of progress |
34 // made on the animation, where 0.0 is the beginning and 1.0 is the end. The | 34 // made on the animation, where 0.0 is the beginning and 1.0 is the end. The |
35 // animation should be linear (not eased in or out) so that it can be played | 35 // animation should be linear (not eased in or out) so that it can be played |
36 // forwards or reversed. Easing will be applied by the PaginationModel. | 36 // forwards or reversed. Easing will be applied by the PaginationModel. |
37 virtual void Update(double progress, int from_page, int to_page) = 0; | 37 virtual void Update(double progress, int from_page, int to_page) = 0; |
38 | 38 |
39 protected: | 39 protected: |
40 const ContentsView* contents_view() const { return contents_view_; } | 40 const ContentsView* contents_view() const { return contents_view_; } |
41 | 41 |
42 // Gets the on-screen page bounds for a given launcher page with index | |
43 // |page_index|. | |
44 gfx::Rect GetOnscreenPageBounds(int page_index) const; | |
45 | |
46 // Gets the origin (the off-screen resting place) for a given launcher page | |
47 // with index |page_index|. | |
48 gfx::Rect GetOffscreenPageBounds(int page_index) const; | |
49 | |
50 // Updates the position of the custom launcher page view (if it exists), in | 42 // Updates the position of the custom launcher page view (if it exists), in |
51 // the default way for start page <-> other page transitions. This places it | 43 // the default way for start page <-> other page transitions. This places it |
52 // into collapsed state on the start page, and hidden on any other page. Any | 44 // into collapsed state on the start page, and hidden on any other page. Any |
53 // other behaviour should be implemented with a custom animator. |progress|, | 45 // other behaviour should be implemented with a custom animator. |progress|, |
54 // |from_page| and |to_page| are parameters from Update(). | 46 // |from_page| and |to_page| are parameters from Update(). |
55 void UpdateCustomPageForDefaultAnimation(double progress, | 47 void UpdateCustomPageForDefaultAnimation(double progress, |
56 int from_page, | 48 int from_page, |
57 int to_page) const; | 49 int to_page) const; |
58 | 50 |
59 // Updates the position of the search box view, placing it in the correct | 51 // Updates the position of the search box view, placing it in the correct |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 std::string NameForTests() const override; | 104 std::string NameForTests() const override; |
113 void Update(double progress, int start_page, int custom_page) override; | 105 void Update(double progress, int start_page, int custom_page) override; |
114 | 106 |
115 private: | 107 private: |
116 DISALLOW_COPY_AND_ASSIGN(StartToCustomAnimator); | 108 DISALLOW_COPY_AND_ASSIGN(StartToCustomAnimator); |
117 }; | 109 }; |
118 | 110 |
119 } // namespace app_list | 111 } // namespace app_list |
120 | 112 |
121 #endif // UI_APP_LIST_VIEWS_CONTENTS_ANIMATOR_H_ | 113 #endif // UI_APP_LIST_VIEWS_CONTENTS_ANIMATOR_H_ |
OLD | NEW |