summaryrefslogtreecommitdiffstats
path: root/chrome/browser/background_mode_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/background_mode_manager.h')
-rw-r--r--chrome/browser/background_mode_manager.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/browser/background_mode_manager.h b/chrome/browser/background_mode_manager.h
index 38b010c..46e8847 100644
--- a/chrome/browser/background_mode_manager.h
+++ b/chrome/browser/background_mode_manager.h
@@ -38,7 +38,7 @@ class BackgroundModeManager
: private NotificationObserver,
private menus::SimpleMenuModel::Delegate {
public:
- explicit BackgroundModeManager(Profile* profile);
+ BackgroundModeManager(Profile* profile, CommandLine* command_line);
virtual ~BackgroundModeManager();
static void RegisterUserPrefs(PrefService* prefs);
@@ -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_;