| Index: chrome/browser/background/background_mode_manager.h
|
| diff --git a/chrome/browser/background/background_mode_manager.h b/chrome/browser/background/background_mode_manager.h
|
| index a190ca018b447612518a60ab484d647cf031bed1..0469c0d122b67bcfa73ae6e04b2e4fa5dc4eccb6 100644
|
| --- a/chrome/browser/background/background_mode_manager.h
|
| +++ b/chrome/browser/background/background_mode_manager.h
|
| @@ -15,6 +15,7 @@
|
| #include "base/memory/scoped_vector.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "chrome/browser/background/background_application_list_model.h"
|
| +#include "chrome/browser/lifetime/scoped_keep_alive.h"
|
| #include "chrome/browser/profiles/profile_attributes_storage.h"
|
| #include "chrome/browser/status_icons/status_icon.h"
|
| #include "chrome/browser/status_icons/status_icon_menu_model.h"
|
| @@ -317,6 +318,10 @@ class BackgroundModeManager
|
| // is active and not suspended.
|
| virtual void UpdateKeepAliveAndTrayIcon();
|
|
|
| + // Release keep_alive_for_startup_. This is invoked as a callback to make
|
| + // make sure the message queue was initialized before we attempt to exit.
|
| + void ReleaseStartupKeepAlive();
|
| +
|
| // If --no-startup-window is passed, BackgroundModeManager will manually keep
|
| // chrome running while waiting for apps to load. This is called when we no
|
| // longer need to do this (either because the user has chosen to exit chrome
|
| @@ -413,10 +418,14 @@ class BackgroundModeManager
|
| // user disables/enables background mode via preferences.
|
| bool in_background_mode_;
|
|
|
| + // Background mode does not always keep Chrome alive. When it does, it is
|
| + // using this scoped object.
|
| + scoped_ptr<ScopedKeepAlive> keep_alive_;
|
| +
|
| // Set when we are keeping chrome running during the startup process - this
|
| // is required when running with the --no-startup-window flag, as otherwise
|
| // chrome would immediately exit due to having no open windows.
|
| - bool keep_alive_for_startup_;
|
| + scoped_ptr<ScopedKeepAlive> keep_alive_for_startup_;
|
|
|
| // Set to true when Chrome is running with the --keep-alive-for-test flag
|
| // (used for testing background mode without having to install a background
|
| @@ -426,9 +435,6 @@ class BackgroundModeManager
|
| // Set to true when background mode is suspended.
|
| bool background_mode_suspended_;
|
|
|
| - // Set to true when background mode is keeping Chrome alive.
|
| - bool keeping_alive_;
|
| -
|
| base::WeakPtrFactory<BackgroundModeManager> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager);
|
|
|