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

Side by Side Diff: chrome/browser/ui/app_list/app_list_shower_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_shower_views.h" 5 #include "chrome/browser/ui/app_list/app_list_shower_views.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 12 matching lines...) Expand all
23 profile_(NULL), 23 profile_(NULL),
24 app_list_(NULL), 24 app_list_(NULL),
25 window_icon_updated_(false) { 25 window_icon_updated_(false) {
26 } 26 }
27 27
28 AppListShower::~AppListShower() { 28 AppListShower::~AppListShower() {
29 } 29 }
30 30
31 void AppListShower::ShowForCurrentProfile() { 31 void AppListShower::ShowForCurrentProfile() {
32 DCHECK(HasView()); 32 DCHECK(HasView());
33 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::APP_LIST_SHOWER)); 33 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::APP_LIST_SHOWER,
34 KeepAliveRestartOption::DISABLED));
34 35
35 // If the app list is already displaying |profile| just activate it (in case 36 // If the app list is already displaying |profile| just activate it (in case
36 // we have lost focus). 37 // we have lost focus).
37 if (!IsAppListVisible()) 38 if (!IsAppListVisible())
38 delegate_->MoveNearCursor(app_list_); 39 delegate_->MoveNearCursor(app_list_);
39 40
40 Show(); 41 Show();
41 } 42 }
42 43
43 gfx::NativeWindow AppListShower::GetWindow() { 44 gfx::NativeWindow AppListShower::GetWindow() {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 FROM_HERE, 151 FROM_HERE,
151 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); 152 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this)));
152 return; 153 return;
153 } 154 }
154 ResetKeepAlive(); 155 ResetKeepAlive();
155 } 156 }
156 157
157 void AppListShower::ResetKeepAlive() { 158 void AppListShower::ResetKeepAlive() {
158 keep_alive_.reset(); 159 keep_alive_.reset();
159 } 160 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_views.cc ('k') | chrome/browser/ui/app_list/profile_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698