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_info_cache.h" | 5 #include "chrome/browser/profiles/profile_info_cache.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 311 } |
312 | 312 |
313 base::string16 ProfileInfoCache::GetUserNameOfProfileAtIndex( | 313 base::string16 ProfileInfoCache::GetUserNameOfProfileAtIndex( |
314 size_t index) const { | 314 size_t index) const { |
315 base::string16 user_name; | 315 base::string16 user_name; |
316 GetInfoForProfileAtIndex(index)->GetString(kUserNameKey, &user_name); | 316 GetInfoForProfileAtIndex(index)->GetString(kUserNameKey, &user_name); |
317 return user_name; | 317 return user_name; |
318 } | 318 } |
319 | 319 |
320 const gfx::Image& ProfileInfoCache::GetAvatarIconOfProfileAtIndex( | 320 const gfx::Image& ProfileInfoCache::GetAvatarIconOfProfileAtIndex( |
321 size_t index) const { | 321 size_t index) { |
322 if (IsUsingGAIAPictureOfProfileAtIndex(index)) { | 322 if (IsUsingGAIAPictureOfProfileAtIndex(index)) { |
323 const gfx::Image* image = GetGAIAPictureOfProfileAtIndex(index); | 323 const gfx::Image* image = GetGAIAPictureOfProfileAtIndex(index); |
324 if (image) | 324 if (image) |
325 return *image; | 325 return *image; |
326 } | 326 } |
327 | 327 |
328 // Use the high resolution version of the avatar if it exists. | 328 // Use the high resolution version of the avatar if it exists. |
329 if (switches::IsNewAvatarMenu()) { | 329 if (switches::IsNewAvatarMenu()) { |
330 const gfx::Image* image = GetHighResAvatarOfProfileAtIndex(index); | 330 const gfx::Image* image = GetHighResAvatarOfProfileAtIndex(index); |
331 if (image) | 331 if (image) |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 std::vector<base::FilePath>::const_iterator it; | 1163 std::vector<base::FilePath>::const_iterator it; |
1164 for (it = profiles_to_rename.begin(); it != profiles_to_rename.end(); ++it) { | 1164 for (it = profiles_to_rename.begin(); it != profiles_to_rename.end(); ++it) { |
1165 size_t profile_index = GetIndexOfProfileWithPath(*it); | 1165 size_t profile_index = GetIndexOfProfileWithPath(*it); |
1166 SetProfileIsUsingDefaultNameAtIndex(profile_index, true); | 1166 SetProfileIsUsingDefaultNameAtIndex(profile_index, true); |
1167 // This will assign a new "Person %d" type name and re-sort the cache. | 1167 // This will assign a new "Person %d" type name and re-sort the cache. |
1168 SetNameOfProfileAtIndex(profile_index, ChooseNameForNewProfile( | 1168 SetNameOfProfileAtIndex(profile_index, ChooseNameForNewProfile( |
1169 GetAvatarIconIndexOfProfileAtIndex(profile_index))); | 1169 GetAvatarIconIndexOfProfileAtIndex(profile_index))); |
1170 } | 1170 } |
1171 #endif | 1171 #endif |
1172 } | 1172 } |
OLD | NEW |