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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 171523004: Stop using the old-style profile names when using --new-profile-management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved new tests behind no-android/no-cros ifdef 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 if (profile_cache_index != std::string::npos) { 714 if (profile_cache_index != std::string::npos) {
715 avatar_index = 715 avatar_index =
716 cache.GetAvatarIconIndexOfProfileAtIndex(profile_cache_index); 716 cache.GetAvatarIconIndexOfProfileAtIndex(profile_cache_index);
717 profile_name = 717 profile_name =
718 base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_cache_index)); 718 base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_cache_index));
719 managed_user_id = 719 managed_user_id =
720 cache.GetManagedUserIdOfProfileAtIndex(profile_cache_index); 720 cache.GetManagedUserIdOfProfileAtIndex(profile_cache_index);
721 } else if (profile->GetPath() == 721 } else if (profile->GetPath() ==
722 profiles::GetDefaultProfileDir(cache.GetUserDataDir())) { 722 profiles::GetDefaultProfileDir(cache.GetUserDataDir())) {
723 avatar_index = 0; 723 avatar_index = 0;
724 profile_name = l10n_util::GetStringUTF8(IDS_DEFAULT_PROFILE_NAME); 724 // The --new-profile-management flag no longer uses the "First User" name.
725 profile_name = switches::IsNewProfileManagement() ?
726 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)) :
727 l10n_util::GetStringUTF8(IDS_DEFAULT_PROFILE_NAME);
725 } else { 728 } else {
726 avatar_index = cache.ChooseAvatarIconIndexForNewProfile(); 729 avatar_index = cache.ChooseAvatarIconIndexForNewProfile();
727 profile_name = 730 profile_name =
728 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)); 731 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index));
729 } 732 }
730 } 733 }
731 734
732 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileAvatarIndex)) 735 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileAvatarIndex))
733 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarIndex, avatar_index); 736 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarIndex, avatar_index);
734 737
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 last_non_managed_profile_path.BaseName().MaybeAsASCII()); 1240 last_non_managed_profile_path.BaseName().MaybeAsASCII());
1238 FinishDeletingProfile(profile_to_delete_path); 1241 FinishDeletingProfile(profile_to_delete_path);
1239 } 1242 }
1240 } 1243 }
1241 } 1244 }
1242 #endif 1245 #endif
1243 1246
1244 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1247 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1245 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1248 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1246 } 1249 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698