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

Unified Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 9317002: Make the auto-launch experiment profile-aware. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Delete the Run key on profile deletion Created 8 years, 10 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
Index: chrome/browser/profiles/profile_info_cache.cc
===================================================================
--- chrome/browser/profiles/profile_info_cache.cc (revision 120769)
+++ chrome/browser/profiles/profile_info_cache.cc (working copy)
@@ -32,6 +32,10 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_util.h"
+#if defined(OS_WIN)
+#include "chrome/installer/util/auto_launch_util.h"
+#endif
+
using content::BrowserThread;
namespace {
@@ -163,6 +167,17 @@
file_util::Delete(image_path, false);
}
+#if defined(OS_WIN)
+void DeleteAutoLaunchValueForProfile(
+ const FilePath& profile_path) {
+ if (auto_launch_util::WillLaunchAtLogin(FilePath(),
+ profile_path.BaseName().value())) {
+ auto_launch_util::SetWillLaunchAtLogin(
+ false, FilePath(), profile_path.BaseName().value());
+ }
+}
+#endif
+
} // namespace
ProfileInfoCache::ProfileInfoCache(PrefService* prefs,
@@ -238,6 +253,12 @@
cache->Remove(key, NULL);
sorted_keys_.erase(std::find(sorted_keys_.begin(), sorted_keys_.end(), key));
+#if defined(OS_WIN)
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&DeleteAutoLaunchValueForProfile, profile_path));
grt (UTC plus 2) 2012/02/09 16:43:50 shouldn't this be more like the ProfileShortcutMan
+#endif
+
FOR_EACH_OBSERVER(ProfileInfoCacheObserver,
observer_list_,
OnProfileWasRemoved(profile_path, name));

Powered by Google App Engine
This is Rietveld 408576698