Chromium Code Reviews| 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 8bfabe87d6ee5fdc80119c82dcca6387d5fafd12..039633ca26192642c0528e7eff603352b244cde8 100644 |
| --- a/chrome/browser/background/background_mode_manager.h |
| +++ b/chrome/browser/background/background_mode_manager.h |
| @@ -26,6 +26,7 @@ |
| #include "content/public/browser/notification_registrar.h" |
| #include "extensions/common/extension_id.h" |
| +class BackgroundModeOptimizer; |
| class BackgroundTrigger; |
| class Browser; |
| class PrefRegistrySimple; |
| @@ -79,6 +80,16 @@ class BackgroundModeManager |
| // Opens a new browser window if there isn't one for the active desktop. |
| static Browser* GetBrowserWindowForProfile(Profile* profile); |
| + // Getter and setter for the flag indicating whether Chrome should start in |
| + // background mode the next time. |
| + static bool should_restart_in_background() { |
| + return BackgroundModeManager::should_restart_in_background_; |
|
sky
2016/07/22 16:57:52
Why do you need BackgroundModeManager:: here and l
dgn
2016/07/25 17:32:28
Not needed. Removed
|
| + } |
| + |
| + static void should_restart_in_background(bool enable) { |
|
sky
2016/07/22 16:57:52
set_should...
dgn
2016/07/25 17:32:28
Done.
|
| + BackgroundModeManager::should_restart_in_background_ = enable; |
| + } |
| + |
| // Returns true if background mode is active. |
| virtual bool IsBackgroundModeActive(); |
| @@ -314,7 +325,7 @@ class BackgroundModeManager |
| // and has a status bar icon. |
| void StartBackgroundMode(); |
| - // Invoked to take Chrome out of KeepAlive mode - chrome stops running in |
| + // Invoked to take Chrome out of KeepAlive mode - Chrome stops running in |
| // the background and removes its status bar icon. |
| void EndBackgroundMode(); |
| @@ -389,6 +400,11 @@ class BackgroundModeManager |
| // if the profile isn't locked. Returns NULL otherwise. |
| BackgroundModeData* GetBackgroundModeDataForLastProfile() const; |
| + // Set to true when the next restart should be done in background mode. |
| + // Static because its value is read after the background mode manager is |
| + // destroyed. |
| + static bool should_restart_in_background_; |
| + |
| // Reference to the ProfileAttributesStorage. It is used to update the |
| // background app status of profiles when they open/close background apps. |
| ProfileAttributesStorage* profile_storage_; |
| @@ -431,6 +447,10 @@ class BackgroundModeManager |
| // chrome would immediately exit due to having no open windows. |
| std::unique_ptr<ScopedKeepAlive> keep_alive_for_startup_; |
| + // Reference to the optimizer to use to reduce Chrome's footprint when in |
| + // background mode. If null, optimizations are disabled. |
| + std::unique_ptr<BackgroundModeOptimizer> optimizer_; |
| + |
| // 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 |
| // app). |