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

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

Issue 336313010: App List: Refactor ContentsSwitcherView so it doesn't hard-code pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 6 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/contents_switcher_view.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 9e048a19b982eb0fd2dd4c1d396c187c9e5253f3..ed2abb348f9acb642be67350f160ccfdc54d0e16 100644
--- a/ui/app_list/views/contents_view.h
+++ b/ui/app_list/views/contents_view.h
@@ -28,6 +28,7 @@ class AppListMainView;
class AppListModel;
class AppListViewDelegate;
class AppsContainerView;
+class ContentsSwitcherView;
class PaginationModel;
class SearchResultListView;
class StartPageView;
@@ -48,11 +49,14 @@ class APP_LIST_EXPORT ContentsView : public views::View,
NAMED_PAGE_START,
};
- ContentsView(AppListMainView* app_list_main_view,
- AppListModel* model,
- AppListViewDelegate* view_delegate);
+ 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);
+
// The app list gets closed and drag and drop operations need to be cancelled.
void CancelDrag();
@@ -61,6 +65,11 @@ class APP_LIST_EXPORT ContentsView : public views::View,
void SetDragAndDropHostOfCurrentAppList(
ApplicationDragAndDropHost* drag_and_drop_host);
+ void set_contents_switcher_view(
+ ContentsSwitcherView* contents_switcher_view) {
+ contents_switcher_view_ = contents_switcher_view;
+ }
+
void ShowSearchResults(bool show);
void ShowFolderContent(AppListFolderItem* folder);
bool IsShowingSearchResults() const;
@@ -114,14 +123,16 @@ class APP_LIST_EXPORT ContentsView : public views::View,
void UpdatePageBounds();
// 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. There is no name
+ // view is inserted as a child of the ContentsView, and a button with
+ // |resource_id| is added to the ContentsSwitcherView. There is no name
// associated with the page. Returns the index of the new page.
- int AddLauncherPage(views::View* view);
+ int AddLauncherPage(views::View* view, int resource_id);
// 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. The page is associated
+ // 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, NamedPage named_page);
+ int AddLauncherPage(views::View* view, int resource_id, NamedPage named_page);
// Gets the PaginationModel owned by the AppsGridView.
// Note: This is different to |pagination_model_|, which manages top-level
@@ -138,6 +149,8 @@ class APP_LIST_EXPORT ContentsView : public views::View,
StartPageView* start_page_view_;
AppListMainView* app_list_main_view_; // Parent view, owns this.
+ // Sibling view, owned by |app_list_main_view_|.
+ ContentsSwitcherView* contents_switcher_view_;
scoped_ptr<views::ViewModel> view_model_;
// Maps NamedPage onto |view_model_| indices.
« no previous file with comments | « ui/app_list/views/contents_switcher_view.cc ('k') | ui/app_list/views/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698