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

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

Issue 186803003: Use custom profile names (if available) for signed in profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/profiles/profile_info_interface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profiles_state.cc
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
index cfbf333812973f3027bb6287ee4f18abc4e435db..3c8aa1b5c7e1dad3c39fdf2b10cbf5f2e55ca343 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -4,8 +4,6 @@
#include "chrome/browser/profiles/profiles_state.h"
-#include <stdio.h>
-
#include "base/files/file_path.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
@@ -72,13 +70,7 @@ base::string16 GetAvatarNameForProfile(Profile* profile) {
// or the user has edited the profile name, or there are multiple profiles,
// it will return the actual name of the profile.
base::string16 profile_name = cache.GetNameOfProfileAtIndex(index);
- std::string default_name_format = l10n_util::GetStringFUTF8(
- IDS_NEW_NUMBERED_PROFILE_NAME, base::string16()) + "%d";
- int generic_profile_number; // Unused. Just a placeholder for sscanf.
- int assignments = sscanf(base::UTF16ToUTF8(profile_name).c_str(),
- default_name_format.c_str(),
- &generic_profile_number);
- bool has_default_name = (assignments == 1);
+ bool has_default_name = cache.ProfileIsUsingDefaultNameAtIndex(index);
if (cache.GetNumberOfProfiles() == 1 && has_default_name &&
cache.GetUserNameOfProfileAtIndex(index).empty()) {
« no previous file with comments | « chrome/browser/profiles/profile_info_interface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698