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

Unified Diff: chrome/browser/background/background_mode_manager.cc

Issue 13982009: Fix issue with login items getting recreated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comments/review feedback. Created 7 years, 8 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 | « no previous file | chrome/browser/background/background_mode_manager_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698