Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: chrome/browser/profiles/profile_attributes_entry.cc

Issue 1794353003: Refactor ProfileInfoCache in c/b/profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bug that causes unit tests without debug code to fail. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_attributes_entry.h ('k') | chrome/browser/profiles/profile_attributes_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698