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

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

Issue 1913373002: Revert "Refactor ProfileInfoCache in most of c/b/profiles" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
183 void ProfileAttributesEntry::SetIsOmitted(bool is_omitted) { 179 void ProfileAttributesEntry::SetIsOmitted(bool is_omitted) {
184 profile_info_cache_->SetIsOmittedProfileAtIndex(profile_index(), is_omitted); 180 profile_info_cache_->SetIsOmittedProfileAtIndex(profile_index(), is_omitted);
185 } 181 }
186 182
187 void ProfileAttributesEntry::SetSupervisedUserId(const std::string& id) { 183 void ProfileAttributesEntry::SetSupervisedUserId(const std::string& id) {
188 profile_info_cache_->SetSupervisedUserIdOfProfileAtIndex(profile_index(), id); 184 profile_info_cache_->SetSupervisedUserIdOfProfileAtIndex(profile_index(), id);
189 } 185 }
190 186
191 void ProfileAttributesEntry::SetLocalAuthCredentials(const std::string& auth) { 187 void ProfileAttributesEntry::SetLocalAuthCredentials(const std::string& auth) {
192 profile_info_cache_->SetLocalAuthCredentialsOfProfileAtIndex( 188 profile_info_cache_->SetLocalAuthCredentialsOfProfileAtIndex(
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 const std::string& gaia_id, const base::string16& user_name) { 267 const std::string& gaia_id, const base::string16& user_name) {
272 profile_info_cache_->SetAuthInfoOfProfileAtIndex( 268 profile_info_cache_->SetAuthInfoOfProfileAtIndex(
273 profile_index(), gaia_id, user_name); 269 profile_index(), gaia_id, user_name);
274 } 270 }
275 271
276 size_t ProfileAttributesEntry::profile_index() const { 272 size_t ProfileAttributesEntry::profile_index() const {
277 size_t index = profile_info_cache_->GetIndexOfProfileWithPath(profile_path_); 273 size_t index = profile_info_cache_->GetIndexOfProfileWithPath(profile_path_);
278 DCHECK(index < profile_info_cache_->GetNumberOfProfiles()); 274 DCHECK(index < profile_info_cache_->GetNumberOfProfiles());
279 return index; 275 return index;
280 } 276 }
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