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

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

Issue 466733003: [Profiles] Always use the placeholder avatar when creating new profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 // If the cache has an entry for this profile, use the cache data. 770 // If the cache has an entry for this profile, use the cache data.
771 if (profile_cache_index != std::string::npos) { 771 if (profile_cache_index != std::string::npos) {
772 avatar_index = 772 avatar_index =
773 cache.GetAvatarIconIndexOfProfileAtIndex(profile_cache_index); 773 cache.GetAvatarIconIndexOfProfileAtIndex(profile_cache_index);
774 profile_name = 774 profile_name =
775 base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_cache_index)); 775 base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_cache_index));
776 supervised_user_id = 776 supervised_user_id =
777 cache.GetSupervisedUserIdOfProfileAtIndex(profile_cache_index); 777 cache.GetSupervisedUserIdOfProfileAtIndex(profile_cache_index);
778 } else if (profile->GetPath() == 778 } else if (profile->GetPath() ==
779 profiles::GetDefaultProfileDir(cache.GetUserDataDir())) { 779 profiles::GetDefaultProfileDir(cache.GetUserDataDir())) {
780 // The --new-avatar-menu flag no longer uses the "First User" name, 780 // The --new-avatar-menu flag no longer uses the "First User" name.
781 // and should assign the default avatar icon to all new profiles.
782 bool is_new_avatar_menu = switches::IsNewAvatarMenu(); 781 bool is_new_avatar_menu = switches::IsNewAvatarMenu();
783 avatar_index = is_new_avatar_menu ? 782 avatar_index = profiles::GetPlaceholderAvatarIndex();
784 profiles::GetPlaceholderAvatarIndex() : 0;
785 profile_name = is_new_avatar_menu ? 783 profile_name = is_new_avatar_menu ?
786 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)) : 784 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)) :
787 l10n_util::GetStringUTF8(IDS_DEFAULT_PROFILE_NAME); 785 l10n_util::GetStringUTF8(IDS_DEFAULT_PROFILE_NAME);
788 } else { 786 } else {
789 avatar_index = cache.ChooseAvatarIconIndexForNewProfile(); 787 avatar_index = cache.ChooseAvatarIconIndexForNewProfile();
790 profile_name = 788 profile_name =
791 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index)); 789 base::UTF16ToUTF8(cache.ChooseNameForNewProfile(avatar_index));
792 } 790 }
793 } 791 }
794 792
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); 1322 last_non_supervised_profile_path.BaseName().MaybeAsASCII());
1325 FinishDeletingProfile(profile_to_delete_path); 1323 FinishDeletingProfile(profile_to_delete_path);
1326 } 1324 }
1327 } 1325 }
1328 } 1326 }
1329 #endif 1327 #endif
1330 1328
1331 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1329 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1332 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1330 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1333 } 1331 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698