summaryrefslogtreecommitdiffstats
path: root/chrome/browser/background_mode_manager.h
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 23:17:23 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 23:17:23 +0000
commitab08260d36bbcea95b1010b5e7eae79c12f45dcd (patch)
tree846a21f811c6132d197a9153450f8e78ecd5f7ce /chrome/browser/background_mode_manager.h
parentfe9eb4f9d93a56a26d99fba1d3d3761fd6590fb2 (diff)
downloadchromium_src-ab08260d36bbcea95b1010b5e7eae79c12f45dcd.zip
chromium_src-ab08260d36bbcea95b1010b5e7eae79c12f45dcd.tar.gz
chromium_src-ab08260d36bbcea95b1010b5e7eae79c12f45dcd.tar.bz2
Disable background mode when associated pref changes.
BUG=53173 TEST=new BackgroundModeManager unit tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57642 Review URL: http://codereview.chromium.org/3205008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background_mode_manager.h')
-rw-r--r--chrome/browser/background_mode_manager.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/background_mode_manager.h b/chrome/browser/background_mode_manager.h
index 38b010c..9970391 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);
@@ -121,6 +130,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_;