OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_attributes_entry.h" | 5 #include "chrome/browser/profiles/profile_attributes_entry.h" |
6 #include "chrome/browser/profiles/profile_info_cache.h" | 6 #include "chrome/browser/profiles/profile_info_cache.h" |
7 | 7 |
8 ProfileAttributesEntry::ProfileAttributesEntry() | 8 ProfileAttributesEntry::ProfileAttributesEntry() |
9 : profile_info_cache_(nullptr), | 9 : profile_info_cache_(nullptr), |
10 profile_path_(base::FilePath()) {} | 10 profile_path_(base::FilePath()) {} |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 base::Time ProfileAttributesEntry::GetActiveTime() const { | 34 base::Time ProfileAttributesEntry::GetActiveTime() const { |
35 return profile_info_cache_->GetProfileActiveTimeAtIndex(profile_index()); | 35 return profile_info_cache_->GetProfileActiveTimeAtIndex(profile_index()); |
36 } | 36 } |
37 | 37 |
38 base::string16 ProfileAttributesEntry::GetUserName() const { | 38 base::string16 ProfileAttributesEntry::GetUserName() const { |
39 return profile_info_cache_->GetUserNameOfProfileAtIndex(profile_index()); | 39 return profile_info_cache_->GetUserNameOfProfileAtIndex(profile_index()); |
40 } | 40 } |
41 | 41 |
42 const gfx::Image& ProfileAttributesEntry::GetAvatarIcon() { | 42 const gfx::Image& ProfileAttributesEntry::GetAvatarIcon() const { |
43 return profile_info_cache_->GetAvatarIconOfProfileAtIndex(profile_index()); | 43 return profile_info_cache_->GetAvatarIconOfProfileAtIndex(profile_index()); |
44 } | 44 } |
45 | 45 |
46 std::string ProfileAttributesEntry::GetLocalAuthCredentials() const { | 46 std::string ProfileAttributesEntry::GetLocalAuthCredentials() const { |
47 return profile_info_cache_->GetLocalAuthCredentialsOfProfileAtIndex( | 47 return profile_info_cache_->GetLocalAuthCredentialsOfProfileAtIndex( |
48 profile_index()); | 48 profile_index()); |
49 } | 49 } |
50 | 50 |
51 std::string ProfileAttributesEntry::GetPasswordChangeDetectionToken() const { | 51 std::string ProfileAttributesEntry::GetPasswordChangeDetectionToken() const { |
52 return profile_info_cache_->GetPasswordChangeDetectionTokenAtIndex( | 52 return profile_info_cache_->GetPasswordChangeDetectionTokenAtIndex( |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 const std::string& gaia_id, const base::string16& user_name) { | 267 const std::string& gaia_id, const base::string16& user_name) { |
268 profile_info_cache_->SetAuthInfoOfProfileAtIndex( | 268 profile_info_cache_->SetAuthInfoOfProfileAtIndex( |
269 profile_index(), gaia_id, user_name); | 269 profile_index(), gaia_id, user_name); |
270 } | 270 } |
271 | 271 |
272 size_t ProfileAttributesEntry::profile_index() const { | 272 size_t ProfileAttributesEntry::profile_index() const { |
273 size_t index = profile_info_cache_->GetIndexOfProfileWithPath(profile_path_); | 273 size_t index = profile_info_cache_->GetIndexOfProfileWithPath(profile_path_); |
274 DCHECK(index < profile_info_cache_->GetNumberOfProfiles()); | 274 DCHECK(index < profile_info_cache_->GetNumberOfProfiles()); |
275 return index; | 275 return index; |
276 } | 276 } |
OLD | NEW |