| OLD | NEW |
| 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_CONTENTS_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| 6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Shows/hides the search results. Hiding the search results will cause the | 64 // Shows/hides the search results. Hiding the search results will cause the |
| 65 // app list to return to the page that was displayed before | 65 // app list to return to the page that was displayed before |
| 66 // ShowSearchResults(true) was invoked. | 66 // ShowSearchResults(true) was invoked. |
| 67 void ShowSearchResults(bool show); | 67 void ShowSearchResults(bool show); |
| 68 bool IsShowingSearchResults() const; | 68 bool IsShowingSearchResults() const; |
| 69 | 69 |
| 70 void ShowFolderContent(AppListFolderItem* folder); | 70 void ShowFolderContent(AppListFolderItem* folder); |
| 71 | 71 |
| 72 // Sets the active launcher page and animates the pages into place. | 72 // Sets the active launcher page and animates the pages into place. |
| 73 void SetActivePage(int page_index); | 73 void SetActiveState(AppListModel::State state); |
| 74 void SetActivePage(int page_index, bool animate); | 74 void SetActiveState(AppListModel::State state, bool animate); |
| 75 | 75 |
| 76 // The index of the currently active launcher page. | 76 // The index of the currently active launcher page. |
| 77 int GetActivePageIndex() const; | 77 int GetActivePageIndex() const; |
| 78 | 78 |
| 79 // The currently active state. | 79 // The currently active state. |
| 80 AppListModel::State GetActiveState() const; | 80 AppListModel::State GetActiveState() const; |
| 81 | 81 |
| 82 // True if |state| is the current active laucher page. | 82 // True if |state| is the current active laucher page. |
| 83 bool IsStateActive(AppListModel::State state) const; | 83 bool IsStateActive(AppListModel::State state) const; |
| 84 | 84 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 101 views::View* custom_page_view() const { return custom_page_view_; } | 101 views::View* custom_page_view() const { return custom_page_view_; } |
| 102 SearchResultPageView* search_results_page_view() { | 102 SearchResultPageView* search_results_page_view() { |
| 103 return search_results_page_view_; | 103 return search_results_page_view_; |
| 104 } | 104 } |
| 105 views::View* GetPageView(int index) const; | 105 views::View* GetPageView(int index) const; |
| 106 | 106 |
| 107 SearchBoxView* GetSearchBoxView() const; | 107 SearchBoxView* GetSearchBoxView() const; |
| 108 | 108 |
| 109 AppListMainView* app_list_main_view() const { return app_list_main_view_; } | 109 AppListMainView* app_list_main_view() const { return app_list_main_view_; } |
| 110 | 110 |
| 111 // Adds a blank launcher page. For use in tests only. | |
| 112 void AddBlankPageForTesting(); | |
| 113 | |
| 114 // Returns the pagination model for the ContentsView. | 111 // Returns the pagination model for the ContentsView. |
| 115 const PaginationModel& pagination_model() { return pagination_model_; } | 112 const PaginationModel& pagination_model() { return pagination_model_; } |
| 116 | 113 |
| 117 // Gets the on-screen page bounds for a given launcher page with index | 114 // Gets the on-screen page bounds for a given launcher page with index |
| 118 // |page_index|. | 115 // |page_index|. |
| 119 gfx::Rect GetOnscreenPageBounds(int page_index) const; | 116 gfx::Rect GetOnscreenPageBounds(int page_index) const; |
| 120 | 117 |
| 121 // Gets the the off-screen resting place for a given launcher page with index | 118 // Gets the the off-screen resting place for a given launcher page with index |
| 122 // |page_index|. | 119 // |page_index|. |
| 123 gfx::Rect GetOffscreenPageBounds(int page_index) const; | 120 gfx::Rect GetOffscreenPageBounds(int page_index) const; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 156 |
| 160 // Overridden from PaginationModelObserver: | 157 // Overridden from PaginationModelObserver: |
| 161 void TotalPagesChanged() override; | 158 void TotalPagesChanged() override; |
| 162 void SelectedPageChanged(int old_selected, int new_selected) override; | 159 void SelectedPageChanged(int old_selected, int new_selected) override; |
| 163 void TransitionStarted() override; | 160 void TransitionStarted() override; |
| 164 void TransitionChanged() override; | 161 void TransitionChanged() override; |
| 165 | 162 |
| 166 private: | 163 private: |
| 167 // Sets the active launcher page, accounting for whether the change is for | 164 // Sets the active launcher page, accounting for whether the change is for |
| 168 // search results. | 165 // search results. |
| 169 void SetActivePageInternal(int page_index, | 166 void SetActiveStateInternal(int page_index, |
| 170 bool show_search_results, | 167 bool show_search_results, |
| 171 bool animate); | 168 bool animate); |
| 172 | 169 |
| 173 // Invoked when active view is changed. | 170 // Invoked when active view is changed. |
| 174 void ActivePageChanged(); | 171 void ActivePageChanged(); |
| 175 | 172 |
| 176 // Returns the size of the default content area. | 173 // Returns the size of the default content area. |
| 177 gfx::Size GetDefaultContentsSize() const; | 174 gfx::Size GetDefaultContentsSize() const; |
| 178 | 175 |
| 179 // Notifies the view delegate that the custom launcher page's animation has | 176 // Notifies the view delegate that the custom launcher page's animation has |
| 180 // changed. | 177 // changed. |
| 181 void NotifyCustomLauncherPageAnimationChanged(double progress, | 178 void NotifyCustomLauncherPageAnimationChanged(double progress, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 243 |
| 247 // The animator for transitions not found in |contents_animators_|. | 244 // The animator for transitions not found in |contents_animators_|. |
| 248 scoped_ptr<ContentsAnimator> default_animator_; | 245 scoped_ptr<ContentsAnimator> default_animator_; |
| 249 | 246 |
| 250 DISALLOW_COPY_AND_ASSIGN(ContentsView); | 247 DISALLOW_COPY_AND_ASSIGN(ContentsView); |
| 251 }; | 248 }; |
| 252 | 249 |
| 253 } // namespace app_list | 250 } // namespace app_list |
| 254 | 251 |
| 255 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 252 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| OLD | NEW |