Index: ui/app_list/views/contents_view.h |
diff --git a/ui/app_list/views/contents_view.h b/ui/app_list/views/contents_view.h |
index 698f807ebaa8f5e675d75d6363b1402fd32c7dce..8aea3f7be9226938f53f40efdc143c839d9ae0d5 100644 |
--- a/ui/app_list/views/contents_view.h |
+++ b/ui/app_list/views/contents_view.h |
@@ -11,6 +11,7 @@ |
#include "base/compiler_specific.h" |
#include "base/memory/scoped_ptr.h" |
#include "ui/app_list/app_list_export.h" |
+#include "ui/app_list/app_list_model.h" |
#include "ui/app_list/pagination_model.h" |
#include "ui/app_list/pagination_model_observer.h" |
#include "ui/views/view.h" |
@@ -45,21 +46,13 @@ class StartPageView; |
class APP_LIST_EXPORT ContentsView : public views::View, |
public PaginationModelObserver { |
public: |
- // Values of this enum denote special launcher pages that require hard-coding. |
- // Launcher pages are not required to have a NamedPage enum value. |
- enum NamedPage { |
- NAMED_PAGE_APPS, |
- NAMED_PAGE_SEARCH_RESULTS, |
- NAMED_PAGE_START, |
- }; |
- |
ContentsView(AppListMainView* app_list_main_view); |
virtual ~ContentsView(); |
- // Initialize the named (special) pages of the launcher. In the experimental |
- // launcher, should be called after set_contents_switcher_view(), or switcher |
- // buttons will not be created. |
- void InitNamedPages(AppListModel* model, AppListViewDelegate* view_delegate); |
+ // Initialize the pages of the launcher. In the experimental launcher, should |
+ // be called after set_contents_switcher_view(), or switcher buttons will not |
+ // be created. |
+ void Init(AppListModel* model, AppListViewDelegate* view_delegate); |
// The app list gets closed and drag and drop operations need to be cancelled. |
void CancelDrag(); |
@@ -85,12 +78,12 @@ class APP_LIST_EXPORT ContentsView : public views::View, |
// The index of the currently active launcher page. |
int GetActivePageIndex() const; |
- // True if |named_page| is the current active laucher page. |
- bool IsNamedPageActive(NamedPage named_page) const; |
+ // True if |show_state| is the current active laucher page. |
+ bool IsShowStateActive(AppListModel::ShowState show_state) const; |
- // Gets the index of a launcher page in |view_model_|, by NamedPage. Returns |
- // -1 if there is no view for |named_page|. |
- int GetPageIndexForNamedPage(NamedPage named_page) const; |
+ // Gets the index of a launcher page in |view_model_|, by ShowState. Returns |
+ // -1 if there is no view for |show_state|. |
+ int GetPageIndexForShowState(AppListModel::ShowState show_state) const; |
int NumLauncherPages() const; |
@@ -152,8 +145,10 @@ class APP_LIST_EXPORT ContentsView : public views::View, |
// Adds |view| as a new page to the end of the list of launcher pages. The |
// view is inserted as a child of the ContentsView, and a button with |
// |resource_id| is added to the ContentsSwitcherView. The page is associated |
- // with the name |named_page|. Returns the index of the new page. |
- int AddLauncherPage(views::View* view, int resource_id, NamedPage named_page); |
+ // with the name |show_state|. Returns the index of the new page. |
+ int AddLauncherPage(views::View* view, |
+ int resource_id, |
+ AppListModel::ShowState show_state); |
// Gets the PaginationModel owned by the AppsGridView. |
// Note: This is different to |pagination_model_|, which manages top-level |
@@ -170,8 +165,8 @@ class APP_LIST_EXPORT ContentsView : public views::View, |
ContentsSwitcherView* contents_switcher_view_; |
scoped_ptr<views::ViewModel> view_model_; |
- // Maps NamedPage onto |view_model_| indices. |
- std::map<NamedPage, int> named_page_to_view_; |
+ // Maps ShowState onto |view_model_| indices. |
+ std::map<AppListModel::ShowState, int> show_state_to_view_; |
// The page that was showing before ShowSearchResults(true) was invoked. |
int page_before_search_; |