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

Unified Diff: ui/app_list/views/contents_view.h

Issue 675053002: Move ContentsView::NamedPage to AppListModel::ShowState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/ares_move_search_box_up
Patch Set: rebase Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/views/app_list_view_unittest.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3a11f4b362010ca50707614d34abbf8114f792a3..e142af1e9c1ac72d8299defebbd670c43b17b43e 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"
@@ -42,21 +43,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();
@@ -82,12 +75,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 |state| is the current active laucher page.
+ bool IsStateActive(AppListModel::State 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 State. Returns
+ // -1 if there is no view for |state|.
+ int GetPageIndexForState(AppListModel::State state) const;
int NumLauncherPages() const;
@@ -151,8 +144,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 |state|. Returns the index of the new page.
+ int AddLauncherPage(views::View* view,
+ int resource_id,
+ AppListModel::State state);
// Gets the PaginationModel owned by the AppsGridView.
// Note: This is different to |pagination_model_|, which manages top-level
@@ -169,8 +164,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 State onto |view_model_| indices.
+ std::map<AppListModel::State, int> state_to_view_;
// The page that was showing before ShowSearchResults(true) was invoked.
int page_before_search_;
« no previous file with comments | « ui/app_list/views/app_list_view_unittest.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698