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

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

Issue 958133005: Fix custom launcher pages showing when setEnabled(false) is called. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tab_focus_SOLVED
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
« 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/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 df9f32b49734ed99b4df132e90fb4f3d58072eb3..02690dcd951aca64b8f3c29c007520cca3f82d57 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -251,27 +251,11 @@ bool AppListMainView::ShouldShowCustomLauncherPage() const {
}
void AppListMainView::UpdateCustomLauncherPageVisibility() {
- if (ShouldShowCustomLauncherPage()) {
- // Make the custom page view visible again.
- contents_view_->custom_page_view()->SetVisible(true);
- } else if (contents_view_->IsStateActive(
- 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));
- } else {
- // Hide the view immediately otherwise.
- contents_view_->custom_page_view()->SetVisible(false);
- }
-}
-
-void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) {
views::View* custom_page = contents_view_->custom_page_view();
if (!custom_page)
return;
- if (enabled) {
+ if (ShouldShowCustomLauncherPage()) {
Matt Giuca 2015/02/27 06:11:33 Could you get this to work by JUST doing this chan
calamity 2015/03/02 02:39:26 Done.
// Make the custom page view visible again.
custom_page->SetVisible(true);
} else if (contents_view_->IsStateActive(
@@ -286,9 +270,13 @@ void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) {
}
}
+void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) {
+ UpdateCustomLauncherPageVisibility();
+}
+
void AppListMainView::OnSearchEngineIsGoogleChanged(bool is_google) {
if (contents_view_->custom_page_view())
- OnCustomLauncherPageEnabledStateChanged(is_google);
+ UpdateCustomLauncherPageVisibility();
if (contents_view_->start_page_view()) {
contents_view_->start_page_view()->instant_container()->SetVisible(
« 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