| 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 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 SetActivePage(int page_index); |
| 74 | 74 |
| 75 // The index of the currently active launcher page. | 75 // The index of the currently active launcher page. |
| 76 int GetActivePageIndex() const; | 76 int GetActivePageIndex() const; |
| 77 | 77 |
| 78 // True if |state| is the current active laucher page. | 78 // True if |state| is the current active laucher page. |
| 79 bool IsStateActive(AppListModel::State state) const; | 79 bool IsStateActive(AppListModel::State state) const; |
| 80 | 80 |
| 81 // Gets the index of a launcher page in |view_model_|, by State. Returns | 81 // Gets the index of a launcher page in |view_model_| by State. Returns |
| 82 // -1 if there is no view for |state|. | 82 // -1 if there is no view for |state|. |
| 83 int GetPageIndexForState(AppListModel::State state) const; | 83 int GetPageIndexForState(AppListModel::State state) const; |
| 84 | 84 |
| 85 // Gets the State of a launcher page in |view_model_| by index. Returns |
| 86 // INVALID_STATE if there is no State for |index|. |
| 87 AppListModel::State GetStateForPageIndex(int index) const; |
| 88 |
| 85 int NumLauncherPages() const; | 89 int NumLauncherPages() const; |
| 86 | 90 |
| 87 void Prerender(); | 91 void Prerender(); |
| 88 | 92 |
| 89 AppsContainerView* apps_container_view() { return apps_container_view_; } | 93 AppsContainerView* apps_container_view() { return apps_container_view_; } |
| 90 StartPageView* start_page_view() { return start_page_view_; } | 94 StartPageView* start_page_view() { return start_page_view_; } |
| 91 SearchResultListView* search_results_view() { return search_results_view_; } | 95 SearchResultListView* search_results_view() { return search_results_view_; } |
| 92 views::View* GetPageView(int index); | 96 views::View* GetPageView(int index); |
| 93 | 97 |
| 94 // Adds a blank launcher page. For use in tests only. | 98 // Adds a blank launcher page. For use in tests only. |
| 95 void AddBlankPageForTesting(); | 99 void AddBlankPageForTesting(); |
| 96 | 100 |
| 97 // Returns the pagination model for the ContentsView. | 101 // Returns the pagination model for the ContentsView. |
| 98 const PaginationModel& pagination_model() { return pagination_model_; } | 102 PaginationModel* pagination_model() { return &pagination_model_; } |
| 99 | 103 |
| 100 // Returns search box bounds to use for content views that do not specify | 104 // Returns search box bounds to use for content views that do not specify |
| 101 // their own custom layout. | 105 // their own custom layout. |
| 102 gfx::Rect GetDefaultSearchBoxBounds() const; | 106 gfx::Rect GetDefaultSearchBoxBounds() const; |
| 103 | 107 |
| 104 // Returns the content area bounds to use for content views that do not | 108 // Returns the content area bounds to use for content views that do not |
| 105 // specify their own custom layout. | 109 // specify their own custom layout. |
| 106 gfx::Rect GetDefaultContentsBounds() const; | 110 gfx::Rect GetDefaultContentsBounds() const; |
| 107 | 111 |
| 108 // Overridden from views::View: | 112 // Overridden from views::View: |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 180 |
| 177 // Manages the pagination for the launcher pages. | 181 // Manages the pagination for the launcher pages. |
| 178 PaginationModel pagination_model_; | 182 PaginationModel pagination_model_; |
| 179 | 183 |
| 180 DISALLOW_COPY_AND_ASSIGN(ContentsView); | 184 DISALLOW_COPY_AND_ASSIGN(ContentsView); |
| 181 }; | 185 }; |
| 182 | 186 |
| 183 } // namespace app_list | 187 } // namespace app_list |
| 184 | 188 |
| 185 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 189 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| OLD | NEW |