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

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

Issue 526983002: Experimental app list: Move custom launcher pages to the end. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/contents_view.cc
diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc
index e6ae0a847c6114b7700cba88486a2344bf539f39..8f8932f12e278ad4c899879cbe570d68c76377c5 100644
--- a/ui/app_list/views/contents_view.cc
+++ b/ui/app_list/views/contents_view.cc
@@ -56,15 +56,6 @@ void ContentsView::InitNamedPages(AppListModel* model,
DCHECK(model);
if (app_list::switches::IsExperimentalAppListEnabled()) {
- std::vector<views::View*> custom_page_views =
- view_delegate->CreateCustomPageWebViews(GetLocalBounds().size());
- for (std::vector<views::View*>::const_iterator it =
- custom_page_views.begin();
- it != custom_page_views.end();
- ++it) {
- AddLauncherPage(*it, IDR_APP_LIST_NOTIFICATIONS_ICON);
- }
-
start_page_view_ = new StartPageView(app_list_main_view_, view_delegate);
AddLauncherPage(
start_page_view_, IDR_APP_LIST_SEARCH_ICON, NAMED_PAGE_START);
@@ -77,10 +68,23 @@ void ContentsView::InitNamedPages(AppListModel* model,
apps_container_view_ = new AppsContainerView(app_list_main_view_, model);
- int initial_page_index = AddLauncherPage(
+ AddLauncherPage(
apps_container_view_, IDR_APP_LIST_APPS_ICON, NAMED_PAGE_APPS);
- if (app_list::switches::IsExperimentalAppListEnabled())
- initial_page_index = GetPageIndexForNamedPage(NAMED_PAGE_START);
+
+ if (app_list::switches::IsExperimentalAppListEnabled()) {
+ std::vector<views::View*> custom_page_views =
+ view_delegate->CreateCustomPageWebViews(GetLocalBounds().size());
+ for (std::vector<views::View*>::const_iterator it =
+ custom_page_views.begin();
+ it != custom_page_views.end();
+ ++it) {
+ AddLauncherPage(*it, IDR_APP_LIST_NOTIFICATIONS_ICON);
+ }
+ }
+
+ int initial_page_index = app_list::switches::IsExperimentalAppListEnabled()
+ ? GetPageIndexForNamedPage(NAMED_PAGE_START)
+ : GetPageIndexForNamedPage(NAMED_PAGE_APPS);
page_before_search_ = initial_page_index;
pagination_model_.SelectPage(initial_page_index, false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698