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

Unified Diff: chrome/browser/background/background_mode_manager.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/lifetime/keep_alive_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background/background_mode_manager.cc
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index 5d739b40d392bfaaf4f81add6b6b312c740d2094..c653c9f18ccd3677aced71d9fc016b920ad0e82e 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -311,7 +311,8 @@ BackgroundModeManager::BackgroundModeManager(
// there are background apps) or exit if there are none.
if (command_line.HasSwitch(switches::kNoStartupWindow)) {
keep_alive_for_startup_.reset(
- new ScopedKeepAlive(KeepAliveOrigin::BACKGROUND_MODE_MANAGER));
+ new ScopedKeepAlive(KeepAliveOrigin::BACKGROUND_MODE_MANAGER_STARTUP,
+ KeepAliveRestartOption::DISABLED));
} else {
// Otherwise, start with background mode suspended in case we're launching
// in a mode that doesn't open a browser window. It will be resumed when the
@@ -767,7 +768,8 @@ void BackgroundModeManager::UpdateKeepAliveAndTrayIcon() {
if (in_background_mode_ && !background_mode_suspended_) {
if (!keep_alive_) {
keep_alive_.reset(
- new ScopedKeepAlive(KeepAliveOrigin::BACKGROUND_MODE_MANAGER));
+ new ScopedKeepAlive(KeepAliveOrigin::BACKGROUND_MODE_MANAGER,
+ KeepAliveRestartOption::ENABLED));
}
CreateStatusTrayIcon();
return;
« no previous file with comments | « no previous file | chrome/browser/lifetime/keep_alive_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698