| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 | 318 |
| 319 base::string16 ProfileInfoCache::GetUserNameOfProfileAtIndex( | 319 base::string16 ProfileInfoCache::GetUserNameOfProfileAtIndex( |
| 320 size_t index) const { | 320 size_t index) const { |
| 321 base::string16 user_name; | 321 base::string16 user_name; |
| 322 GetInfoForProfileAtIndex(index)->GetString(kUserNameKey, &user_name); | 322 GetInfoForProfileAtIndex(index)->GetString(kUserNameKey, &user_name); |
| 323 return user_name; | 323 return user_name; |
| 324 } | 324 } |
| 325 | 325 |
| 326 const gfx::Image& ProfileInfoCache::GetAvatarIconOfProfileAtIndex( | 326 const gfx::Image& ProfileInfoCache::GetAvatarIconOfProfileAtIndex( |
| 327 size_t index) { | 327 size_t index) const { |
| 328 if (IsUsingGAIAPictureOfProfileAtIndex(index)) { | 328 if (IsUsingGAIAPictureOfProfileAtIndex(index)) { |
| 329 const gfx::Image* image = GetGAIAPictureOfProfileAtIndex(index); | 329 const gfx::Image* image = GetGAIAPictureOfProfileAtIndex(index); |
| 330 if (image) | 330 if (image) |
| 331 return *image; | 331 return *image; |
| 332 } | 332 } |
| 333 | 333 |
| 334 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) | 334 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) |
| 335 // Use the high resolution version of the avatar if it exists. Mobile and | 335 // Use the high resolution version of the avatar if it exists. Mobile and |
| 336 // ChromeOS don't need the high resolution version so no need to fetch it. | 336 // ChromeOS don't need the high resolution version so no need to fetch it. |
| 337 const gfx::Image* image = GetHighResAvatarOfProfileAtIndex(index); | 337 const gfx::Image* image = GetHighResAvatarOfProfileAtIndex(index); |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 // The profile info is in the cache but its entry isn't created yet, insert | 1281 // The profile info is in the cache but its entry isn't created yet, insert |
| 1282 // it in the map. | 1282 // it in the map. |
| 1283 scoped_ptr<ProfileAttributesEntry> new_entry(new ProfileAttributesEntry()); | 1283 scoped_ptr<ProfileAttributesEntry> new_entry(new ProfileAttributesEntry()); |
| 1284 profile_attributes_entries_.add(path, new_entry.Pass()); | 1284 profile_attributes_entries_.add(path, new_entry.Pass()); |
| 1285 profile_attributes_entries_.get(path)->Initialize(this, path); | 1285 profile_attributes_entries_.get(path)->Initialize(this, path); |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 *entry = profile_attributes_entries_.get(path); | 1288 *entry = profile_attributes_entries_.get(path); |
| 1289 return true; | 1289 return true; |
| 1290 } | 1290 } |
| OLD | NEW |