| Index: chrome/browser/background/background_mode_manager.cc
|
| diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
|
| index b70667d022f7de9d1ef5975057a520d75953ce41..52298ad5ee8a4eec4c0408600a125b33745bb861 100644
|
| --- a/chrome/browser/background/background_mode_manager.cc
|
| +++ b/chrome/browser/background/background_mode_manager.cc
|
| @@ -225,8 +225,11 @@ BackgroundModeManager::~BackgroundModeManager() {
|
|
|
| // static
|
| void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
|
| - registry->RegisterBooleanPref(prefs::kUserCreatedLoginItem, false);
|
| +#if defined(OS_MACOSX)
|
| registry->RegisterBooleanPref(prefs::kUserRemovedLoginItem, false);
|
| + registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
|
| + registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
|
| +#endif
|
| registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true);
|
| }
|
|
|
| @@ -382,16 +385,10 @@ void BackgroundModeManager::OnApplicationListChanged(Profile* profile) {
|
| // background mode.
|
| if (!in_background_mode_) {
|
| // We're entering background mode - make sure we have launch-on-startup
|
| - // enabled.
|
| - // On a Mac, we use 'login items' mechanism which has user-facing UI so we
|
| - // don't want to stomp on user choice every time we start and load
|
| - // registered extensions. This means that if a background app is removed
|
| - // or added while Chrome is not running, we could leave Chrome in the
|
| - // wrong state, but this is better than constantly forcing Chrome to
|
| - // launch on startup even after the user removes the LoginItem manually.
|
| -#if !defined(OS_MACOSX)
|
| + // enabled. On Mac, the platform-specific code tracks whether the user
|
| + // has deleted a login item in the past, and if so, no login item will
|
| + // be created (to avoid overriding the specific user action).
|
| EnableLaunchOnStartup(true);
|
| -#endif
|
|
|
| StartBackgroundMode();
|
| }
|
| @@ -630,15 +627,6 @@ void BackgroundModeManager::OnBackgroundAppInstalled(
|
| if (!IsBackgroundModePrefEnabled())
|
| return;
|
|
|
| - // Special behavior for the Mac: We enable "launch-on-startup" only on new app
|
| - // installation rather than every time we go into background mode. This is
|
| - // because the Mac exposes "Open at Login" UI to the user and we don't want to
|
| - // clobber the user's selection on every browser launch.
|
| - // Other platforms enable launch-on-startup in OnApplicationListChanged().
|
| -#if defined(OS_MACOSX)
|
| - EnableLaunchOnStartup(true);
|
| -#endif
|
| -
|
| // Check if we need a status tray icon and make one if we do (needed so we
|
| // can display the app-installed notification below).
|
| CreateStatusTrayIcon();
|
|
|