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

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: Created 4 years, 10 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
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 b219e831d9b66ce6977c0c6b73964aaf6214bbe7..45a89f2b8d30bd0cce08db671c3f1cbe5d0df35f 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(keep_alive::Origin::BACKGROUND_MODE_MANAGER));
+ new ScopedKeepAlive(keep_alive::Origin::BACKGROUND_MODE_MANAGER_STARTUP,
Bernhard Bauer 2016/02/24 16:54:33 Are we ever going to use the same origin with diff
dgn 2016/02/24 19:08:32 Up to callers to decide what to do with their orig
+ keep_alive::RestartOption::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
@@ -765,10 +766,10 @@ void BackgroundModeManager::ResumeBackgroundMode() {
void BackgroundModeManager::UpdateKeepAliveAndTrayIcon() {
if (in_background_mode_ && !background_mode_suspended_) {
- if (!keep_alive_) {
+ if (!keep_alive_)
Bernhard Bauer 2016/02/24 16:54:33 Keep the braces, as the body is more than one line
keep_alive_.reset(
- new ScopedKeepAlive(keep_alive::Origin::BACKGROUND_MODE_MANAGER));
- }
+ new ScopedKeepAlive(keep_alive::Origin::BACKGROUND_MODE_MANAGER,
+ keep_alive::RestartOption::ENABLED));
CreateStatusTrayIcon();
return;
}
« no previous file with comments | « no previous file | chrome/browser/lifetime/keep_alive_registry.h » ('j') | chrome/browser/lifetime/keep_alive_registry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698