diff options
author | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 06:39:22 +0000 |
---|---|---|
committer | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 06:39:22 +0000 |
commit | 97a1122a346843cd92c74173c6011d0abd810816 (patch) | |
tree | 21332d63c36c31c0beaa2c1dcd407b8222b75ba7 /chrome/browser/background_mode_manager.h | |
parent | 6506f2aee4619a49f4ac32e729f7a01e34b9d8e8 (diff) | |
download | chromium_src-97a1122a346843cd92c74173c6011d0abd810816.zip chromium_src-97a1122a346843cd92c74173c6011d0abd810816.tar.gz chromium_src-97a1122a346843cd92c74173c6011d0abd810816.tar.bz2 |
Disable background mode when associated pref changes.
BUG=53173
TEST=new BackgroundModeManager unit tests
Review URL: http://codereview.chromium.org/3205008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background_mode_manager.h')
-rw-r--r-- | chrome/browser/background_mode_manager.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/background_mode_manager.h b/chrome/browser/background_mode_manager.h index 3a82399..0408cc2 100644 --- a/chrome/browser/background_mode_manager.h +++ b/chrome/browser/background_mode_manager.h @@ -49,6 +49,12 @@ class BackgroundModeManager BackgroundAppLoadUnload); FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest, BackgroundAppInstallUninstall); + FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest, + BackgroundPrefDisabled); + FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest, + BackgroundPrefDynamicDisable); + FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest, + BackgroundPrefDynamicEnable); // NotificationObserver implementation. virtual void Observe(NotificationType type, @@ -76,6 +82,9 @@ class BackgroundModeManager // launch-on-startup is disabled if appropriate. void OnBackgroundAppUninstalled(); + // Invoked when the kBackgroundModeEnabled preference has changed. + void OnBackgroundModePrefChanged(); + // Returns true if the passed extension is a background app. bool IsBackgroundApp(Extension* extension); @@ -115,6 +124,11 @@ class BackgroundModeManager // The number of background apps currently loaded. int background_app_count_; + // Set to true when we are running in background mode. Allows us to track our + // current background state so we can take the appropriate action when the + // user disables/enables background mode via preferences. + bool in_background_mode_; + // Reference to our status tray (owned by our parent profile). If null, the // platform doesn't support status icons. StatusTray* status_tray_; |