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

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

Issue 947903002: Change ContentsView::SetActivePage to use States rather than indexes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
Index: ui/app_list/views/app_list_main_view.cc
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index 705af09978b6c5fd059b39f6af270217878b2ee3..11bda7e1eacd98438e320a6f2e883cc2a58c1959 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -144,10 +144,9 @@ void AppListMainView::ShowAppListWhenReady() {
}
void AppListMainView::ResetForShow() {
- if (switches::IsExperimentalAppListEnabled()) {
- contents_view_->SetActivePage(
- contents_view_->GetPageIndexForState(AppListModel::STATE_START));
- }
+ if (switches::IsExperimentalAppListEnabled())
+ contents_view_->SetActivePage(AppListModel::STATE_START);
+
contents_view_->apps_container_view()->ResetForShowApps();
// We clear the search when hiding so when app list appears it is not showing
// search results.
@@ -258,8 +257,7 @@ void AppListMainView::UpdateCustomLauncherPageVisibility() {
AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)) {
// Animate to the start page if currently on the custom page view. The view
// will hide on animation completion.
- contents_view_->SetActivePage(
- contents_view_->GetPageIndexForState(AppListModel::STATE_START));
+ contents_view_->SetActivePage(AppListModel::STATE_START);
} else {
// Hide the view immediately otherwise.
contents_view_->custom_page_view()->SetVisible(false);
@@ -274,8 +272,7 @@ void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) {
AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)) {
// Animate to the start page if currently on the custom page view. The view
// will hide on animation completion.
- contents_view_->SetActivePage(
- contents_view_->GetPageIndexForState(AppListModel::STATE_START));
+ contents_view_->SetActivePage(AppListModel::STATE_START);
} else {
// Hide the view immediately otherwise.
contents_view_->custom_page_view()->SetVisible(false);

Powered by Google App Engine
This is Rietveld 408576698