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

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

Issue 212603011: Newly created profiles should have the grey silhouette as avatar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor parallel arrays; trungl's suggestions Created 6 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
Index: chrome/browser/profiles/profile_window.cc
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc
index f6ed167e2bff00de546b70efa87ad85b2a933baa..309c1c6e738a590b6075b75dbe84abafbd8d9a02 100644
--- a/chrome/browser/profiles/profile_window.cc
+++ b/chrome/browser/profiles/profile_window.cc
@@ -8,8 +8,10 @@
#include "base/files/file_path.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
@@ -220,9 +222,14 @@ void SwitchToGuestProfile(chrome::HostDesktopType desktop_type,
void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type,
ProfileSwitchingDoneCallback callback,
ProfileMetrics::ProfileAdd metric) {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+
+ int placeholder_avatar_index = profiles::GetPlaceholderAvatarIndex();
ProfileManager::CreateMultiProfileAsync(
- base::string16(),
- base::string16(),
+ cache.ChooseNameForNewProfile(placeholder_avatar_index),
+ base::UTF8ToUTF16(profiles::GetDefaultAvatarIconUrl(
+ placeholder_avatar_index)),
base::Bind(&OpenBrowserWindowForProfile,
callback,
true,

Powered by Google App Engine
This is Rietveld 408576698