OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/users/user.h" | 5 #include "chrome/browser/chromeos/login/users/user.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 is_active_(false), | 201 is_active_(false), |
202 profile_is_created_(false) { | 202 profile_is_created_(false) { |
203 } | 203 } |
204 | 204 |
205 User::~User() {} | 205 User::~User() {} |
206 | 206 |
207 void User::SetAccountLocale(const std::string& resolved_account_locale) { | 207 void User::SetAccountLocale(const std::string& resolved_account_locale) { |
208 account_locale_.reset(new std::string(resolved_account_locale)); | 208 account_locale_.reset(new std::string(resolved_account_locale)); |
209 } | 209 } |
210 | 210 |
211 void User::SetImage(const UserImage& user_image, int image_index) { | 211 void User::SetImage(const user_manager::UserImage& user_image, |
| 212 int image_index) { |
212 user_image_ = user_image; | 213 user_image_ = user_image; |
213 image_index_ = image_index; | 214 image_index_ = image_index; |
214 image_is_stub_ = false; | 215 image_is_stub_ = false; |
215 image_is_loading_ = false; | 216 image_is_loading_ = false; |
216 DCHECK(HasDefaultImage() || user_image.has_raw_image()); | 217 DCHECK(HasDefaultImage() || user_image.has_raw_image()); |
217 } | 218 } |
218 | 219 |
219 void User::SetImageURL(const GURL& image_url) { | 220 void User::SetImageURL(const GURL& image_url) { |
220 user_image_.set_url(image_url); | 221 user_image_.set_url(image_url); |
221 } | 222 } |
222 | 223 |
223 void User::SetStubImage(int image_index, bool is_loading) { | 224 void User::SetStubImage(int image_index, bool is_loading) { |
224 user_image_ = UserImage( | 225 user_image_ = user_manager::UserImage( |
225 *ResourceBundle::GetSharedInstance(). | 226 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
226 GetImageSkiaNamed(IDR_PROFILE_PICTURE_LOADING)); | 227 IDR_PROFILE_PICTURE_LOADING)); |
227 image_index_ = image_index; | 228 image_index_ = image_index; |
228 image_is_stub_ = true; | 229 image_is_stub_ = true; |
229 image_is_loading_ = is_loading; | 230 image_is_loading_ = is_loading; |
230 } | 231 } |
231 | 232 |
232 RegularUser::RegularUser(const std::string& email) : User(email) { | 233 RegularUser::RegularUser(const std::string& email) : User(email) { |
233 set_can_lock(true); | 234 set_can_lock(true); |
234 set_display_email(email); | 235 set_display_email(email); |
235 } | 236 } |
236 | 237 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 case user_manager::USER_TYPE_LOCALLY_MANAGED: | 311 case user_manager::USER_TYPE_LOCALLY_MANAGED: |
311 case user_manager::USER_TYPE_KIOSK_APP: | 312 case user_manager::USER_TYPE_KIOSK_APP: |
312 return false; | 313 return false; |
313 default: | 314 default: |
314 NOTREACHED(); | 315 NOTREACHED(); |
315 } | 316 } |
316 return false; | 317 return false; |
317 } | 318 } |
318 | 319 |
319 } // namespace chromeos | 320 } // namespace chromeos |
OLD | NEW |