OLD | NEW |
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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 if (profile_cache_index != std::string::npos) { | 711 if (profile_cache_index != std::string::npos) { |
712 avatar_index = | 712 avatar_index = |
713 cache.GetAvatarIconIndexOfProfileAtIndex(profile_cache_index); | 713 cache.GetAvatarIconIndexOfProfileAtIndex(profile_cache_index); |
714 profile_name = | 714 profile_name = |
715 base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_cache_index)); | 715 base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_cache_index)); |
716 managed_user_id = | 716 managed_user_id = |
717 cache.GetManagedUserIdOfProfileAtIndex(profile_cache_index); | 717 cache.GetManagedUserIdOfProfileAtIndex(profile_cache_index); |
718 } else if (profile->GetPath() == | 718 } else if (profile->GetPath() == |
719 profiles::GetDefaultProfileDir(cache.GetUserDataDir())) { | 719 profiles::GetDefaultProfileDir(cache.GetUserDataDir())) { |
720 avatar_index = 0; | 720 avatar_index = 0; |
721 profile_name = l10n_util::GetStringUTF8(IDS_DEFAULT_PROFILE_NAME); | 721 // The --new-profile-management flag no longer uses the "First User" name. |
| 722 profile_name = switches::IsNewProfileManagement() ? |
| 723 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)) : |
| 724 l10n_util::GetStringUTF8(IDS_DEFAULT_PROFILE_NAME); |
722 } else { | 725 } else { |
723 avatar_index = cache.ChooseAvatarIconIndexForNewProfile(); | 726 avatar_index = cache.ChooseAvatarIconIndexForNewProfile(); |
724 profile_name = | 727 profile_name = |
725 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)); | 728 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)); |
726 } | 729 } |
727 } | 730 } |
728 | 731 |
729 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileAvatarIndex)) | 732 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileAvatarIndex)) |
730 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarIndex, avatar_index); | 733 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarIndex, avatar_index); |
731 | 734 |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 last_non_managed_profile_path.BaseName().MaybeAsASCII()); | 1237 last_non_managed_profile_path.BaseName().MaybeAsASCII()); |
1235 FinishDeletingProfile(profile_to_delete_path); | 1238 FinishDeletingProfile(profile_to_delete_path); |
1236 } | 1239 } |
1237 } | 1240 } |
1238 } | 1241 } |
1239 #endif | 1242 #endif |
1240 | 1243 |
1241 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1244 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1242 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1245 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1243 } | 1246 } |
OLD | NEW |