Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1094)

Unified Diff: chrome/browser/background_mode_manager.h

Issue 6954001: Add "Keep chrome running in background" preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed problem that was making UI visible on Mac. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | chrome/browser/background_mode_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background_mode_manager.h
diff --git a/chrome/browser/background_mode_manager.h b/chrome/browser/background_mode_manager.h
index 236637f62e5d369750a36f57fc3c5593fb6cd2c2..4ef8d816343bd74b20175a3f13186a52f20b71af 100644
--- a/chrome/browser/background_mode_manager.h
+++ b/chrome/browser/background_mode_manager.h
@@ -46,7 +46,6 @@ class BackgroundModeManager
BackgroundModeManager(Profile* profile, CommandLine* command_line);
virtual ~BackgroundModeManager();
- static bool IsBackgroundModeEnabled(const CommandLine* command_line);
static void RegisterPrefs(PrefService* prefs);
private:
@@ -57,11 +56,9 @@ class BackgroundModeManager
FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest,
BackgroundAppInstallUninstall);
FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest,
- BackgroundPrefDisabled);
+ BackgroundAppInstallUninstallWhileDisabled);
FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest,
- BackgroundPrefDynamicDisable);
- FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest,
- BackgroundPrefDynamicEnable);
+ EnableAfterBackgroundAppInstall);
// NotificationObserver implementation.
virtual void Observe(NotificationType type,
@@ -146,7 +143,24 @@ class BackgroundModeManager
// window.
Browser* GetBrowserWindow();
+ // Returns true if the "Let chrome run in the background" pref is checked.
+ // (virtual to allow overriding in tests).
+ virtual bool IsBackgroundModePrefEnabled();
+
+ // Turns off background mode if it's currently enabled.
+ void DisableBackgroundMode();
+
+ // Turns on background mode if it's currently disabled.
+ void EnableBackgroundMode();
+
+ // Returns true if background mode is permanently disabled for this chrome
+ // session.
+ static bool IsBackgroundModePermanentlyDisabled(
+ const CommandLine* command_line);
+
+ // Registrars for managing our change observers.
NotificationRegistrar registrar_;
+ PrefChangeRegistrar pref_registrar_;
// The parent profile for this object.
Profile* profile_;
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | chrome/browser/background_mode_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698