diff options
author | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 17:55:54 +0000 |
---|---|---|
committer | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 17:55:54 +0000 |
commit | 91484afdf575b8dd68ba92238338085f8758dbcd (patch) | |
tree | 6e1b831f09cf9a910211eb515c91ce320589aae6 /chrome/browser/browser_main_mac.mm | |
parent | d852274be5cd2157e9519c9dc587e29a091032fa (diff) | |
download | chromium_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/browser_main_mac.mm')
-rw-r--r-- | chrome/browser/browser_main_mac.mm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/browser_main_mac.mm b/chrome/browser/browser_main_mac.mm index 5aa5999..a00c47b 100644 --- a/chrome/browser/browser_main_mac.mm +++ b/chrome/browser/browser_main_mac.mm @@ -68,6 +68,15 @@ class BrowserMainPartsMac : public BrowserMainPartsPosix { : BrowserMainPartsPosix(parameters) {} protected: + virtual void PreEarlyInitialization() { + BrowserMainPartsPosix::PreEarlyInitialization(); + + if (mac_util::WasLaunchedAsHiddenLoginItem()) { + CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); + singleton_command_line->AppendSwitch(switches::kNoStartupWindow); + } + } + virtual void PreMainMessageLoopStart() { BrowserMainPartsPosix::PreMainMessageLoopStart(); |