OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |