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/apps/scoped_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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 | 42 |
43 AppListServiceImpl::ShowForAppInstall(profile, extension_id, | 43 AppListServiceImpl::ShowForAppInstall(profile, extension_id, |
44 start_discovery_tracking); | 44 start_discovery_tracking); |
45 } | 45 } |
46 | 46 |
47 void AppListServiceViews::ShowForCustomLauncherPage(Profile* profile) { | 47 void AppListServiceViews::ShowForCustomLauncherPage(Profile* profile) { |
48 ShowForProfileInternal(profile, | 48 ShowForProfileInternal(profile, |
49 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE); | 49 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE); |
50 } | 50 } |
51 | 51 |
52 void AppListServiceViews::HideLauncherPageIfShowing() { | |
53 if (!shower_.IsAppListVisible()) | |
54 return; | |
55 | |
56 app_list::ContentsView* contents_view = | |
57 shower_.app_list()->app_list_main_view()->contents_view(); | |
58 | |
59 if (contents_view->IsStateActive( | |
60 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)) { | |
Matt Giuca
2015/05/14 06:56:02
if (!contents_view->blahblahblah....)
return;
calamity
2015/05/14 08:11:28
Leaving this, as discussed.
| |
61 contents_view->SetActiveState(app_list::AppListModel::STATE_START, true); | |
62 } | |
63 } | |
64 | |
52 void AppListServiceViews::DismissAppList() { | 65 void AppListServiceViews::DismissAppList() { |
53 if (!can_dismiss_) | 66 if (!can_dismiss_) |
54 return; | 67 return; |
55 | 68 |
56 shower_.DismissAppList(); | 69 shower_.DismissAppList(); |
57 } | 70 } |
58 | 71 |
59 bool AppListServiceViews::IsAppListVisible() const { | 72 bool AppListServiceViews::IsAppListVisible() const { |
60 return shower_.IsAppListVisible(); | 73 return shower_.IsAppListVisible(); |
61 } | 74 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 if (state != app_list::AppListModel::INVALID_STATE) { | 118 if (state != app_list::AppListModel::INVALID_STATE) { |
106 app_list::ContentsView* contents_view = | 119 app_list::ContentsView* contents_view = |
107 shower_.app_list()->app_list_main_view()->contents_view(); | 120 shower_.app_list()->app_list_main_view()->contents_view(); |
108 contents_view->SetActiveState(state, | 121 contents_view->SetActiveState(state, |
109 shower_.IsAppListVisible() /* animate */); | 122 shower_.IsAppListVisible() /* animate */); |
110 } | 123 } |
111 | 124 |
112 shower_.ShowForCurrentProfile(); | 125 shower_.ShowForCurrentProfile(); |
113 RecordAppListLaunch(); | 126 RecordAppListLaunch(); |
114 } | 127 } |
OLD | NEW |