| 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 "chrome/browser/apps/scoped_keep_alive.h" | 7 #include "chrome/browser/lifetime/browser_keep_alive.h" |
| 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 9 #include "ui/app_list/app_list_switches.h" | 9 #include "ui/app_list/app_list_switches.h" |
| 10 #include "ui/app_list/views/app_list_main_view.h" | 10 #include "ui/app_list/views/app_list_main_view.h" |
| 11 #include "ui/app_list/views/app_list_view.h" | 11 #include "ui/app_list/views/app_list_view.h" |
| 12 #include "ui/app_list/views/contents_view.h" | 12 #include "ui/app_list/views/contents_view.h" |
| 13 | 13 |
| 14 AppListServiceViews::AppListServiceViews( | 14 AppListServiceViews::AppListServiceViews( |
| 15 scoped_ptr<AppListControllerDelegate> controller_delegate) | 15 scoped_ptr<AppListControllerDelegate> controller_delegate) |
| 16 : shower_(this), | 16 : shower_(this), |
| 17 can_dismiss_(true), | 17 can_dismiss_(true), |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 AppListViewDelegate* AppListServiceViews::GetViewDelegateForCreate() { | 109 AppListViewDelegate* AppListServiceViews::GetViewDelegateForCreate() { |
| 110 return GetViewDelegate(shower_.profile()); | 110 return GetViewDelegate(shower_.profile()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void AppListServiceViews::ShowForProfileInternal( | 113 void AppListServiceViews::ShowForProfileInternal( |
| 114 Profile* profile, | 114 Profile* profile, |
| 115 app_list::AppListModel::State state) { | 115 app_list::AppListModel::State state) { |
| 116 DCHECK(profile); | 116 DCHECK(profile); |
| 117 | 117 |
| 118 ScopedKeepAlive keep_alive; | 118 browser_lifetime::ScopedKeepAlive keep_alive; |
| 119 | 119 |
| 120 CreateForProfile(profile); | 120 CreateForProfile(profile); |
| 121 | 121 |
| 122 if (state != app_list::AppListModel::INVALID_STATE) { | 122 if (state != app_list::AppListModel::INVALID_STATE) { |
| 123 app_list::ContentsView* contents_view = | 123 app_list::ContentsView* contents_view = |
| 124 shower_.app_list()->app_list_main_view()->contents_view(); | 124 shower_.app_list()->app_list_main_view()->contents_view(); |
| 125 contents_view->SetActiveState(state, | 125 contents_view->SetActiveState(state, |
| 126 shower_.IsAppListVisible() /* animate */); | 126 shower_.IsAppListVisible() /* animate */); |
| 127 } | 127 } |
| 128 | 128 |
| 129 shower_.ShowForCurrentProfile(); | 129 shower_.ShowForCurrentProfile(); |
| 130 RecordAppListLaunch(); | 130 RecordAppListLaunch(); |
| 131 } | 131 } |
| OLD | NEW |