| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 base::string16 ProfileInfoCache::GetUserNameOfProfileAtIndex( | 317 base::string16 ProfileInfoCache::GetUserNameOfProfileAtIndex( |
| 318 size_t index) const { | 318 size_t index) const { |
| 319 base::string16 user_name; | 319 base::string16 user_name; |
| 320 GetInfoForProfileAtIndex(index)->GetString(kUserNameKey, &user_name); | 320 GetInfoForProfileAtIndex(index)->GetString(kUserNameKey, &user_name); |
| 321 return user_name; | 321 return user_name; |
| 322 } | 322 } |
| 323 | 323 |
| 324 const gfx::Image& ProfileInfoCache::GetAvatarIconOfProfileAtIndex( | 324 const gfx::Image& ProfileInfoCache::GetAvatarIconOfProfileAtIndex( |
| 325 size_t index) { | 325 size_t index) const { |
| 326 if (IsUsingGAIAPictureOfProfileAtIndex(index)) { | 326 if (IsUsingGAIAPictureOfProfileAtIndex(index)) { |
| 327 const gfx::Image* image = GetGAIAPictureOfProfileAtIndex(index); | 327 const gfx::Image* image = GetGAIAPictureOfProfileAtIndex(index); |
| 328 if (image) | 328 if (image) |
| 329 return *image; | 329 return *image; |
| 330 } | 330 } |
| 331 | 331 |
| 332 // Use the high resolution version of the avatar if it exists. | 332 // Use the high resolution version of the avatar if it exists. |
| 333 if (switches::IsNewAvatarMenu()) { | 333 if (switches::IsNewAvatarMenu()) { |
| 334 const gfx::Image* image = GetHighResAvatarOfProfileAtIndex(index); | 334 const gfx::Image* image = GetHighResAvatarOfProfileAtIndex(index); |
| 335 if (image) | 335 if (image) |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 std::vector<base::FilePath>::const_iterator it; | 1213 std::vector<base::FilePath>::const_iterator it; |
| 1214 for (it = profiles_to_rename.begin(); it != profiles_to_rename.end(); ++it) { | 1214 for (it = profiles_to_rename.begin(); it != profiles_to_rename.end(); ++it) { |
| 1215 size_t profile_index = GetIndexOfProfileWithPath(*it); | 1215 size_t profile_index = GetIndexOfProfileWithPath(*it); |
| 1216 SetProfileIsUsingDefaultNameAtIndex(profile_index, true); | 1216 SetProfileIsUsingDefaultNameAtIndex(profile_index, true); |
| 1217 // This will assign a new "Person %d" type name and re-sort the cache. | 1217 // This will assign a new "Person %d" type name and re-sort the cache. |
| 1218 SetNameOfProfileAtIndex(profile_index, ChooseNameForNewProfile( | 1218 SetNameOfProfileAtIndex(profile_index, ChooseNameForNewProfile( |
| 1219 GetAvatarIconIndexOfProfileAtIndex(profile_index))); | 1219 GetAvatarIconIndexOfProfileAtIndex(profile_index))); |
| 1220 } | 1220 } |
| 1221 #endif | 1221 #endif |
| 1222 } | 1222 } |
| OLD | NEW |