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

Side by Side 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: make into minimal diff fix Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/app_list/views/app_list_main_view.h" 5 #include "ui/app_list/views/app_list_main_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Hide the view immediately otherwise. 264 // Hide the view immediately otherwise.
265 contents_view_->custom_page_view()->SetVisible(false); 265 contents_view_->custom_page_view()->SetVisible(false);
266 } 266 }
267 } 267 }
268 268
269 void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) { 269 void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) {
270 views::View* custom_page = contents_view_->custom_page_view(); 270 views::View* custom_page = contents_view_->custom_page_view();
271 if (!custom_page) 271 if (!custom_page)
272 return; 272 return;
273 273
274 if (enabled) { 274 if (ShouldShowCustomLauncherPage()) {
275 // Make the custom page view visible again. 275 // Make the custom page view visible again.
276 custom_page->SetVisible(true); 276 custom_page->SetVisible(true);
277 } else if (contents_view_->IsStateActive( 277 } else if (contents_view_->IsStateActive(
278 AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)) { 278 AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)) {
279 // Animate to the start page if currently on the custom page view. The view 279 // Animate to the start page if currently on the custom page view. The view
280 // will hide on animation completion. 280 // will hide on animation completion.
281 contents_view_->SetActivePage( 281 contents_view_->SetActivePage(
282 contents_view_->GetPageIndexForState(AppListModel::STATE_START)); 282 contents_view_->GetPageIndexForState(AppListModel::STATE_START));
283 } else { 283 } else {
284 // Hide the view immediately otherwise. 284 // Hide the view immediately otherwise.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 contents_view_->search_results_page_view()->SetSelection(select); 335 contents_view_->search_results_page_view()->SetSelection(select);
336 } 336 }
337 337
338 void AppListMainView::OnResultInstalled(SearchResult* result) { 338 void AppListMainView::OnResultInstalled(SearchResult* result) {
339 // Clears the search to show the apps grid. The last installed app 339 // Clears the search to show the apps grid. The last installed app
340 // should be highlighted and made visible already. 340 // should be highlighted and made visible already.
341 search_box_view_->ClearSearch(); 341 search_box_view_->ClearSearch();
342 } 342 }
343 343
344 } // namespace app_list 344 } // namespace app_list
OLDNEW
« 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