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

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

Issue 9253016: Add a startup check to create profile shortcuts for legacy Chrome profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Added missing ifdefs Created 8 years, 11 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 | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/profile_shortcut_manager_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
===================================================================
--- chrome/browser/profiles/profile_manager.cc (revision 118125)
+++ chrome/browser/profiles/profile_manager.cc (working copy)
@@ -551,6 +551,9 @@
InitProfileUserPrefs(profile);
AddProfileToCache(profile);
DoFinalInitLogging(profile);
+#if defined(OS_WIN)
+ CreateDesktopShortcut(profile);
+#endif
}
void ProfileManager::DoFinalInitForServices(Profile* profile,
@@ -714,6 +717,25 @@
icon_index);
}
+#if defined(OS_WIN)
+void ProfileManager::CreateDesktopShortcut(Profile* profile) {
+ // Some distributions can not create desktop shortcuts, in which case
+ // profile_shortcut_manager_ will not be set.
+ if (!profile_shortcut_manager_.get())
+ return;
+
+ bool shortcut_created =
+ profile->GetPrefs()->GetBoolean(prefs::kProfileShortcutCreated);
+ if (!shortcut_created && GetNumberOfProfiles() > 1) {
+ profile_shortcut_manager_->AddProfileShortcut(profile->GetPath());
+
+ // We only ever create the shortcut for a profile once, so set a pref
+ // reminding us to skip this in the future.
+ profile->GetPrefs()->SetBoolean(prefs::kProfileShortcutCreated, true);
+ }
+}
+#endif
+
void ProfileManager::InitProfileUserPrefs(Profile* profile) {
ProfileInfoCache& cache = GetProfileInfoCache();
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/profile_shortcut_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698