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

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

Issue 14137032: Create profile .ico file on profile creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rework Created 7 years, 7 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_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 6b8fa17a0ac89e8ed8edf00d2aaffffc06d552b9..b6b66cecf584bbbe249997911c6a80d51528ff12 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -159,6 +159,10 @@ static const char kReadmeText[] =
const char* const kPrefExitTypeCrashed = "Crashed";
const char* const kPrefExitTypeSessionEnded = "SessionEnded";
+#if defined(OS_WIN)
+const int kCurrentProfileIconVersion = 1;
+#endif
+
// Helper method needed because PostTask cannot currently take a Callback
// function with non-void return type.
void CreateDirectoryAndSignal(const base::FilePath& path,
@@ -733,6 +737,19 @@ void ProfileImpl::OnPrefsLoaded(bool success) {
// Force this to true in case we fallback and use it.
// TODO(sky): remove this in a couple of releases (m28ish).
prefs_->SetBoolean(prefs::kSessionExitedCleanly, true);
+#if defined(OS_WIN)
+ if (prefs_->GetInteger(prefs::kProfileIconVersion) <
+ kCurrentProfileIconVersion) {
+ // Ensure the profile's icon file has been created.
+ ProfileShortcutManager* profile_shortcut_manager =
+ g_browser_process->profile_manager()->profile_shortcut_manager();
+ if (profile_shortcut_manager) {
+ profile_shortcut_manager->CreateProfileIcon(GetPath());
+ prefs_->SetInteger(prefs::kProfileIconVersion,
+ kCurrentProfileIconVersion);
+ }
+ }
+#endif
BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
this, false);

Powered by Google App Engine
This is Rietveld 408576698