summaryrefslogtreecommitdiffstats
path: root/chrome/browser/background_mode_manager.h
diff options
context:
space:
mode:
authordimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 17:55:54 +0000
committerdimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 17:55:54 +0000
commit91484afdf575b8dd68ba92238338085f8758dbcd (patch)
tree6e1b831f09cf9a910211eb515c91ce320589aae6 /chrome/browser/background_mode_manager.h
parentd852274be5cd2157e9519c9dc587e29a091032fa (diff)
downloadchromium_src-91484afdf575b8dd68ba92238338085f8758dbcd.zip
chromium_src-91484afdf575b8dd68ba92238338085f8758dbcd.tar.gz
chromium_src-91484afdf575b8dd68ba92238338085f8758dbcd.tar.bz2
Re-land. Fixed previous errors.
Implement OSX version for "Start on Login" for background-enabled extensions. When user installs first background-enabled extension we set Chrome to be a hidden "Login Item", and when user uninstalls the last one, we remove Chrome from the "Login Items List". Login Items are the apps that are listed in Systempreferences->Accounts->Login Items, or which have a "Open on Login" check for their Dock icon. Since we manipulate the user-faced UI item here, we try to do it in a way that will likely not interfere with user settings. Most typically, users do not use 'hidden' property, so if we ever encounter setting w/o this property, we won't override. Also there is a hidden preference used to remember the fact that Chrome changed the settings earlier - to avoid override on uninstall of the last persistent app in opposite case. Using the same bit that user can manipulate separately and perhaps even knows about is beneficial since it provides for unified place to "start Chrome on Login" and reduces confusion. Implementation for Login Items List access uses LSSharedFileList API that is available starting 10.5, which I think is our minimal supported version of OSX. BUG=43382 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57569 Reverted Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57614 Reverted Review URL: http://codereview.chromium.org/3163029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background_mode_manager.h')
-rw-r--r--chrome/browser/background_mode_manager.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/background_mode_manager.h b/chrome/browser/background_mode_manager.h
index 3a82399..38b010c 100644
--- a/chrome/browser/background_mode_manager.h
+++ b/chrome/browser/background_mode_manager.h
@@ -82,6 +82,12 @@ class BackgroundModeManager
// Returns true if the background mode preference is enabled
bool IsBackgroundModeEnabled();
+ // Returns true if chrome has set "launch on startup" property for itself
+ // earlier and is allowed to reset it later, reducing likelihood of
+ // overriding user choices.
+ bool IsLaunchOnStartupResetAllowed();
+ void SetLaunchOnStartupResetAllowed(bool allowed);
+
// Called to make sure that our launch-on-startup mode is properly set.
// (virtual so we can override for tests).
virtual void EnableLaunchOnStartup(bool should_launch);