OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/user.h" | 5 #include "chrome/browser/chromeos/login/user.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/login/default_user_images.h" | 10 #include "chrome/browser/chromeos/login/default_user_images.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 165 } |
166 | 166 |
167 bool User::can_lock() const { | 167 bool User::can_lock() const { |
168 return false; | 168 return false; |
169 } | 169 } |
170 | 170 |
171 std::string User::username_hash() const { | 171 std::string User::username_hash() const { |
172 return username_hash_; | 172 return username_hash_; |
173 } | 173 } |
174 | 174 |
| 175 bool User::is_logged_in() const { |
| 176 return is_logged_in_; |
| 177 } |
| 178 |
| 179 bool User::is_active() const { |
| 180 return is_active_; |
| 181 } |
| 182 |
175 User* User::CreateRegularUser(const std::string& email) { | 183 User* User::CreateRegularUser(const std::string& email) { |
176 return new RegularUser(email); | 184 return new RegularUser(email); |
177 } | 185 } |
178 | 186 |
179 User* User::CreateGuestUser() { | 187 User* User::CreateGuestUser() { |
180 return new GuestUser; | 188 return new GuestUser; |
181 } | 189 } |
182 | 190 |
183 User* User::CreateKioskAppUser(const std::string& kiosk_app_username) { | 191 User* User::CreateKioskAppUser(const std::string& kiosk_app_username) { |
184 return new KioskAppUser(kiosk_app_username); | 192 return new KioskAppUser(kiosk_app_username); |
185 } | 193 } |
186 | 194 |
187 User* User::CreateLocallyManagedUser(const std::string& username) { | 195 User* User::CreateLocallyManagedUser(const std::string& username) { |
188 return new LocallyManagedUser(username); | 196 return new LocallyManagedUser(username); |
189 } | 197 } |
190 | 198 |
191 User* User::CreateRetailModeUser() { | 199 User* User::CreateRetailModeUser() { |
192 return new RetailModeUser; | 200 return new RetailModeUser; |
193 } | 201 } |
194 | 202 |
195 User* User::CreatePublicAccountUser(const std::string& email) { | 203 User* User::CreatePublicAccountUser(const std::string& email) { |
196 return new PublicAccountUser(email); | 204 return new PublicAccountUser(email); |
197 } | 205 } |
198 | 206 |
199 User::User(const std::string& email) | 207 User::User(const std::string& email) |
200 : email_(email), | 208 : email_(email), |
201 oauth_token_status_(OAUTH_TOKEN_STATUS_UNKNOWN), | 209 oauth_token_status_(OAUTH_TOKEN_STATUS_UNKNOWN), |
202 image_index_(kInvalidImageIndex), | 210 image_index_(kInvalidImageIndex), |
203 image_is_stub_(false), | 211 image_is_stub_(false), |
204 image_is_loading_(false) { | 212 image_is_loading_(false), |
| 213 is_logged_in_(false), |
| 214 is_active_(false) { |
205 } | 215 } |
206 | 216 |
207 User::~User() {} | 217 User::~User() {} |
208 | 218 |
209 void User::SetImage(const UserImage& user_image, int image_index) { | 219 void User::SetImage(const UserImage& user_image, int image_index) { |
210 user_image_ = user_image; | 220 user_image_ = user_image; |
211 image_index_ = image_index; | 221 image_index_ = image_index; |
212 image_is_stub_ = false; | 222 image_is_stub_ = false; |
213 image_is_loading_ = false; | 223 image_is_loading_ = false; |
214 DCHECK(HasDefaultImage() || user_image.has_raw_image()); | 224 DCHECK(HasDefaultImage() || user_image.has_raw_image()); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 PublicAccountUser::PublicAccountUser(const std::string& email) : User(email) { | 303 PublicAccountUser::PublicAccountUser(const std::string& email) : User(email) { |
294 } | 304 } |
295 | 305 |
296 PublicAccountUser::~PublicAccountUser() {} | 306 PublicAccountUser::~PublicAccountUser() {} |
297 | 307 |
298 User::UserType PublicAccountUser::GetType() const { | 308 User::UserType PublicAccountUser::GetType() const { |
299 return USER_TYPE_PUBLIC_ACCOUNT; | 309 return USER_TYPE_PUBLIC_ACCOUNT; |
300 } | 310 } |
301 | 311 |
302 } // namespace chromeos | 312 } // namespace chromeos |
OLD | NEW |