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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_views.cc

Issue 1725883002: Add KeepAliveStateObserver, add the Restart option (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KeepAlive
Patch Set: Address comments Created 4 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
OLDNEW
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> 7 #include <utility>
8 8
9 #include "chrome/browser/lifetime/keep_alive_types.h" 9 #include "chrome/browser/lifetime/keep_alive_types.h"
10 #include "chrome/browser/lifetime/scoped_keep_alive.h" 10 #include "chrome/browser/lifetime/scoped_keep_alive.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 AppListViewDelegate* AppListServiceViews::GetViewDelegateForCreate() { 111 AppListViewDelegate* AppListServiceViews::GetViewDelegateForCreate() {
112 return GetViewDelegate(shower_.profile()); 112 return GetViewDelegate(shower_.profile());
113 } 113 }
114 114
115 void AppListServiceViews::ShowForProfileInternal( 115 void AppListServiceViews::ShowForProfileInternal(
116 Profile* profile, 116 Profile* profile,
117 app_list::AppListModel::State state) { 117 app_list::AppListModel::State state) {
118 DCHECK(profile); 118 DCHECK(profile);
119 119
120 ScopedKeepAlive keep_alive(KeepAliveOrigin::APP_LIST_SERVICE_VIEWS); 120 ScopedKeepAlive keep_alive(KeepAliveOrigin::APP_LIST_SERVICE_VIEWS,
121 KeepAliveRestartOption::DISABLED);
121 122
122 CreateForProfile(profile); 123 CreateForProfile(profile);
123 124
124 if (state != app_list::AppListModel::INVALID_STATE) { 125 if (state != app_list::AppListModel::INVALID_STATE) {
125 app_list::ContentsView* contents_view = 126 app_list::ContentsView* contents_view =
126 shower_.app_list()->app_list_main_view()->contents_view(); 127 shower_.app_list()->app_list_main_view()->contents_view();
127 contents_view->SetActiveState(state, 128 contents_view->SetActiveState(state,
128 shower_.IsAppListVisible() /* animate */); 129 shower_.IsAppListVisible() /* animate */);
129 } 130 }
130 131
131 shower_.ShowForCurrentProfile(); 132 shower_.ShowForCurrentProfile();
132 RecordAppListLaunch(); 133 RecordAppListLaunch();
133 } 134 }
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/scoped_keep_alive.cc ('k') | chrome/browser/ui/app_list/app_list_shower_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698