| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 void ProfileAttributesEntry::SetName(const base::string16& name) { | 171 void ProfileAttributesEntry::SetName(const base::string16& name) { |
| 172 profile_info_cache_->SetNameOfProfileAtIndex(profile_index(), name); | 172 profile_info_cache_->SetNameOfProfileAtIndex(profile_index(), name); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void ProfileAttributesEntry::SetShortcutName(const base::string16& name) { | 175 void ProfileAttributesEntry::SetShortcutName(const base::string16& name) { |
| 176 profile_info_cache_->SetShortcutNameOfProfileAtIndex(profile_index(), name); | 176 profile_info_cache_->SetShortcutNameOfProfileAtIndex(profile_index(), name); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void ProfileAttributesEntry::SetActiveTimeToNow() { |
| 180 profile_info_cache_->SetProfileActiveTimeAtIndex(profile_index()); |
| 181 } |
| 182 |
| 179 void ProfileAttributesEntry::SetIsOmitted(bool is_omitted) { | 183 void ProfileAttributesEntry::SetIsOmitted(bool is_omitted) { |
| 180 profile_info_cache_->SetIsOmittedProfileAtIndex(profile_index(), is_omitted); | 184 profile_info_cache_->SetIsOmittedProfileAtIndex(profile_index(), is_omitted); |
| 181 } | 185 } |
| 182 | 186 |
| 183 void ProfileAttributesEntry::SetSupervisedUserId(const std::string& id) { | 187 void ProfileAttributesEntry::SetSupervisedUserId(const std::string& id) { |
| 184 profile_info_cache_->SetSupervisedUserIdOfProfileAtIndex(profile_index(), id); | 188 profile_info_cache_->SetSupervisedUserIdOfProfileAtIndex(profile_index(), id); |
| 185 } | 189 } |
| 186 | 190 |
| 187 void ProfileAttributesEntry::SetLocalAuthCredentials(const std::string& auth) { | 191 void ProfileAttributesEntry::SetLocalAuthCredentials(const std::string& auth) { |
| 188 profile_info_cache_->SetLocalAuthCredentialsOfProfileAtIndex( | 192 profile_info_cache_->SetLocalAuthCredentialsOfProfileAtIndex( |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 const std::string& gaia_id, const base::string16& user_name) { | 271 const std::string& gaia_id, const base::string16& user_name) { |
| 268 profile_info_cache_->SetAuthInfoOfProfileAtIndex( | 272 profile_info_cache_->SetAuthInfoOfProfileAtIndex( |
| 269 profile_index(), gaia_id, user_name); | 273 profile_index(), gaia_id, user_name); |
| 270 } | 274 } |
| 271 | 275 |
| 272 size_t ProfileAttributesEntry::profile_index() const { | 276 size_t ProfileAttributesEntry::profile_index() const { |
| 273 size_t index = profile_info_cache_->GetIndexOfProfileWithPath(profile_path_); | 277 size_t index = profile_info_cache_->GetIndexOfProfileWithPath(profile_path_); |
| 274 DCHECK(index < profile_info_cache_->GetNumberOfProfiles()); | 278 DCHECK(index < profile_info_cache_->GetNumberOfProfiles()); |
| 275 return index; | 279 return index; |
| 276 } | 280 } |
| OLD | NEW |