OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/app_list/app_list_service_views.h" | 5 #include "chrome/browser/ui/app_list/app_list_service_views.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "chrome/browser/apps/scoped_keep_alive.h" | 9 #include "chrome/browser/apps/scoped_keep_alive.h" |
8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 10 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
9 #include "ui/app_list/app_list_switches.h" | 11 #include "ui/app_list/app_list_switches.h" |
10 #include "ui/app_list/views/app_list_main_view.h" | 12 #include "ui/app_list/views/app_list_main_view.h" |
11 #include "ui/app_list/views/app_list_view.h" | 13 #include "ui/app_list/views/app_list_view.h" |
12 #include "ui/app_list/views/contents_view.h" | 14 #include "ui/app_list/views/contents_view.h" |
13 | 15 |
14 AppListServiceViews::AppListServiceViews( | 16 AppListServiceViews::AppListServiceViews( |
15 scoped_ptr<AppListControllerDelegate> controller_delegate) | 17 scoped_ptr<AppListControllerDelegate> controller_delegate) |
16 : shower_(this), | 18 : shower_(this), |
17 can_dismiss_(true), | 19 can_dismiss_(true), |
18 controller_delegate_(controller_delegate.Pass()) { | 20 controller_delegate_(std::move(controller_delegate)) {} |
19 } | |
20 | 21 |
21 AppListServiceViews::~AppListServiceViews() {} | 22 AppListServiceViews::~AppListServiceViews() {} |
22 | 23 |
23 void AppListServiceViews::OnViewBeingDestroyed() { | 24 void AppListServiceViews::OnViewBeingDestroyed() { |
24 can_dismiss_ = true; | 25 can_dismiss_ = true; |
25 shower_.HandleViewBeingDestroyed(); | 26 shower_.HandleViewBeingDestroyed(); |
26 } | 27 } |
27 | 28 |
28 void AppListServiceViews::Init(Profile* initial_profile) { | 29 void AppListServiceViews::Init(Profile* initial_profile) { |
29 PerformStartupChecks(initial_profile); | 30 PerformStartupChecks(initial_profile); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (state != app_list::AppListModel::INVALID_STATE) { | 123 if (state != app_list::AppListModel::INVALID_STATE) { |
123 app_list::ContentsView* contents_view = | 124 app_list::ContentsView* contents_view = |
124 shower_.app_list()->app_list_main_view()->contents_view(); | 125 shower_.app_list()->app_list_main_view()->contents_view(); |
125 contents_view->SetActiveState(state, | 126 contents_view->SetActiveState(state, |
126 shower_.IsAppListVisible() /* animate */); | 127 shower_.IsAppListVisible() /* animate */); |
127 } | 128 } |
128 | 129 |
129 shower_.ShowForCurrentProfile(); | 130 shower_.ShowForCurrentProfile(); |
130 RecordAppListLaunch(); | 131 RecordAppListLaunch(); |
131 } | 132 } |
OLD | NEW |