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