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

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

Issue 1214483002: Improve the ProfileInfoCache API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review feedback Created 5 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/profiles/profile_attributes_entry.h"
6 #include "chrome/browser/profiles/profile_info_cache.h"
7
8 ProfileAttributesEntry::ProfileAttributesEntry()
9 : ProfileAttributesEntry(nullptr, std::string::npos) {}
10
11 ProfileAttributesEntry::ProfileAttributesEntry(
12 ProfileInfoCache* cache, size_t index)
13 : profile_info_cache_(cache),
14 profile_index_(index) {}
15
16 base::string16 ProfileAttributesEntry::GetName() const {
17 return profile_info_cache_->GetNameOfProfileAtIndex(profile_index_);
18 }
19
20 base::string16 ProfileAttributesEntry::GetShortcutName() const {
21 return profile_info_cache_->GetShortcutNameOfProfileAtIndex(profile_index_);
22 }
23
24 base::FilePath ProfileAttributesEntry::GetPath() const {
25 return profile_info_cache_->GetPathOfProfileAtIndex(profile_index_);
26 }
27
28 base::Time ProfileAttributesEntry::GetActiveTime() const {
29 return profile_info_cache_->GetProfileActiveTimeAtIndex(profile_index_);
30 }
31
32 base::string16 ProfileAttributesEntry::GetUserName() const {
33 return profile_info_cache_->GetUserNameOfProfileAtIndex(profile_index_);
34 }
35
36 const gfx::Image& ProfileAttributesEntry::GetAvatarIcon() {
37 return profile_info_cache_->GetAvatarIconOfProfileAtIndex(profile_index_);
38 }
39
40 std::string ProfileAttributesEntry::GetLocalAuthCredentials() const {
41 return profile_info_cache_->GetLocalAuthCredentialsOfProfileAtIndex(
42 profile_index_);
43 }
44
45 std::string ProfileAttributesEntry::GetPasswordChangeDetectionToken() const {
46 return profile_info_cache_->GetPasswordChangeDetectionTokenAtIndex(
47 profile_index_);
48 }
49
50 bool ProfileAttributesEntry::GetBackgroundStatus() const {
51 return profile_info_cache_->GetBackgroundStatusOfProfileAtIndex(
52 profile_index_);
53 }
54
55 base::string16 ProfileAttributesEntry::GetGAIAName() const {
56 return profile_info_cache_->GetGAIANameOfProfileAtIndex(profile_index_);
57 }
58
59 base::string16 ProfileAttributesEntry::GetGAIAGivenName() const {
60 return profile_info_cache_->GetGAIAGivenNameOfProfileAtIndex(profile_index_);
61 }
62
63 std::string ProfileAttributesEntry::GetGAIAId() const {
64 return profile_info_cache_->GetGAIAIdOfProfileAtIndex(profile_index_);
65 }
66
67 const gfx::Image* ProfileAttributesEntry::GetGAIAPicture() const {
68 return profile_info_cache_->GetGAIAPictureOfProfileAtIndex(profile_index_);
69 }
70
71 bool ProfileAttributesEntry::IsUsingGAIAPicture() const {
72 return profile_info_cache_->IsUsingGAIAPictureOfProfileAtIndex(
73 profile_index_);
74 }
75
76 bool ProfileAttributesEntry::IsSupervised() const {
77 return profile_info_cache_->ProfileIsSupervisedAtIndex(profile_index_);
78 }
79
80 bool ProfileAttributesEntry::IsChild() const {
81 return profile_info_cache_->ProfileIsChildAtIndex(profile_index_);
82 }
83
84 bool ProfileAttributesEntry::IsLegacySupervised() const {
85 return profile_info_cache_->ProfileIsLegacySupervisedAtIndex(profile_index_);
86 }
87
88 bool ProfileAttributesEntry::IsOmitted() const {
89 return profile_info_cache_->IsOmittedProfileAtIndex(profile_index_);
90 }
91
92 bool ProfileAttributesEntry::IsSigninRequired() const {
93 return profile_info_cache_->ProfileIsSigninRequiredAtIndex(profile_index_);
94 }
95
96 std::string ProfileAttributesEntry::GetSupervisedUserId() const {
97 return profile_info_cache_->GetSupervisedUserIdOfProfileAtIndex(
98 profile_index_);
99 }
100
101 bool ProfileAttributesEntry::IsEphemeral() const {
102 return profile_info_cache_->ProfileIsEphemeralAtIndex(profile_index_);
103 }
104
105 bool ProfileAttributesEntry::IsUsingDefaultName() const {
106 return profile_info_cache_->ProfileIsUsingDefaultNameAtIndex(profile_index_);
107 }
108
109 bool ProfileAttributesEntry::IsAuthenticated() const {
110 return profile_info_cache_->ProfileIsAuthenticatedAtIndex(profile_index_);
111 }
112
113 bool ProfileAttributesEntry::IsUsingDefaultAvatar() const {
114 return profile_info_cache_->ProfileIsUsingDefaultAvatarAtIndex(
115 profile_index_);
116 }
117
118 bool ProfileAttributesEntry::IsAuthError() const {
119 return profile_info_cache_->ProfileIsAuthErrorAtIndex(profile_index_);
120 }
121
122 size_t ProfileAttributesEntry::GetAvatarIconIndex() const {
123 return profile_info_cache_->GetAvatarIconIndexOfProfileAtIndex(
124 profile_index_);
125 }
126
127 void ProfileAttributesEntry::SetName(const base::string16& name) {
128 profile_info_cache_->SetNameOfProfileAtIndex(profile_index_, name);
129 }
130
131 void ProfileAttributesEntry::SetShortcutName(const base::string16& name) {
132 profile_info_cache_->SetShortcutNameOfProfileAtIndex(profile_index_, name);
133 }
134
135 void ProfileAttributesEntry::SetIsOmitted(bool is_omitted) {
136 profile_info_cache_->SetIsOmittedProfileAtIndex(profile_index_, is_omitted);
137 }
138
139 void ProfileAttributesEntry::SetSupervisedUserId(const std::string& id) {
140 profile_info_cache_->SetSupervisedUserIdOfProfileAtIndex(profile_index_, id);
141 }
142
143 void ProfileAttributesEntry::SetLocalAuthCredentials(const std::string& auth) {
144 profile_info_cache_->SetLocalAuthCredentialsOfProfileAtIndex(
145 profile_index_, auth);
146 }
147
148 void ProfileAttributesEntry::SetPasswordChangeDetectionToken(
149 const std::string& token) {
150 profile_info_cache_->SetPasswordChangeDetectionTokenAtIndex(
151 profile_index_, token);
152 }
153
154 void ProfileAttributesEntry::SetBackgroundStatus(bool running_background_apps) {
155 profile_info_cache_->SetBackgroundStatusOfProfileAtIndex(
156 profile_index_, running_background_apps);
157 }
158
159 void ProfileAttributesEntry::SetGAIAName(const base::string16& name) {
160 profile_info_cache_->SetGAIANameOfProfileAtIndex(profile_index_, name);
161 }
162
163 void ProfileAttributesEntry::SetGAIAGivenName(const base::string16& name) {
164 profile_info_cache_->SetGAIAGivenNameOfProfileAtIndex(profile_index_, name);
165 }
166
167 void ProfileAttributesEntry::SetGAIAPicture(const gfx::Image* image) {
168 profile_info_cache_->SetGAIAPictureOfProfileAtIndex(profile_index_, image);
169 }
170
171 void ProfileAttributesEntry::SetIsUsingGAIAPicture(bool value) {
172 profile_info_cache_->SetIsUsingGAIAPictureOfProfileAtIndex(
173 profile_index_, value);
174 }
175
176 void ProfileAttributesEntry::SetIsSigninRequired(bool value) {
177 profile_info_cache_->SetProfileSigninRequiredAtIndex(profile_index_, value);
178 }
179
180 void ProfileAttributesEntry::SetIsEphemeral(bool value) {
181 profile_info_cache_->SetProfileIsEphemeralAtIndex(profile_index_, value);
182 }
183
184 void ProfileAttributesEntry::SetIsUsingDefaultName(bool value) {
185 profile_info_cache_->SetProfileIsUsingDefaultNameAtIndex(
186 profile_index_, value);
187 }
188
189 void ProfileAttributesEntry::SetIsUsingDefaultAvatar(bool value) {
190 profile_info_cache_->SetProfileIsUsingDefaultAvatarAtIndex(
191 profile_index_, value);
192 }
193
194 void ProfileAttributesEntry::SetIsAuthError(bool value) {
195 profile_info_cache_->SetProfileIsAuthErrorAtIndex(profile_index_, value);
196 }
197
198 void ProfileAttributesEntry::SetAvatarIconIndex(size_t icon_index) {
199 profile_info_cache_->SetAvatarIconOfProfileAtIndex(
200 profile_index_, icon_index);
201 }
202
203 void ProfileAttributesEntry::SetAuthInfo(
204 const std::string& gaia_id, const base::string16& user_name) {
205 profile_info_cache_->SetAuthInfoOfProfileAtIndex(
206 profile_index_, gaia_id, user_name);
207 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698