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 "components/user_manager/user.h" | 5 #include "components/user_manager/user.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } | 231 } |
232 | 232 |
233 User* User::CreatePublicAccountUser(const AccountId& account_id) { | 233 User* User::CreatePublicAccountUser(const AccountId& account_id) { |
234 return new PublicAccountUser(account_id); | 234 return new PublicAccountUser(account_id); |
235 } | 235 } |
236 | 236 |
237 void User::SetAccountLocale(const std::string& resolved_account_locale) { | 237 void User::SetAccountLocale(const std::string& resolved_account_locale) { |
238 account_locale_.reset(new std::string(resolved_account_locale)); | 238 account_locale_.reset(new std::string(resolved_account_locale)); |
239 } | 239 } |
240 | 240 |
241 void User::SetImage(scoped_ptr<UserImage> user_image, int image_index) { | 241 void User::SetImage(std::unique_ptr<UserImage> user_image, int image_index) { |
242 user_image_ = std::move(user_image); | 242 user_image_ = std::move(user_image); |
243 image_index_ = image_index; | 243 image_index_ = image_index; |
244 image_is_stub_ = false; | 244 image_is_stub_ = false; |
245 image_is_loading_ = false; | 245 image_is_loading_ = false; |
246 DCHECK(HasDefaultImage() || user_image_->has_image_bytes()); | 246 DCHECK(HasDefaultImage() || user_image_->has_image_bytes()); |
247 } | 247 } |
248 | 248 |
249 void User::SetImageURL(const GURL& image_url) { | 249 void User::SetImageURL(const GURL& image_url) { |
250 user_image_->set_url(image_url); | 250 user_image_->set_url(image_url); |
251 } | 251 } |
252 | 252 |
253 void User::SetStubImage(scoped_ptr<UserImage> stub_user_image, | 253 void User::SetStubImage(std::unique_ptr<UserImage> stub_user_image, |
254 int image_index, | 254 int image_index, |
255 bool is_loading) { | 255 bool is_loading) { |
256 user_image_ = std::move(stub_user_image); | 256 user_image_ = std::move(stub_user_image); |
257 image_index_ = image_index; | 257 image_index_ = image_index; |
258 image_is_stub_ = true; | 258 image_is_stub_ = true; |
259 image_is_loading_ = is_loading; | 259 image_is_loading_ = is_loading; |
260 } | 260 } |
261 | 261 |
262 RegularUser::RegularUser(const AccountId& account_id) : User(account_id) { | 262 RegularUser::RegularUser(const AccountId& account_id) : User(account_id) { |
263 set_can_lock(true); | 263 set_can_lock(true); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 case user_manager::USER_TYPE_SUPERVISED: | 363 case user_manager::USER_TYPE_SUPERVISED: |
364 case user_manager::USER_TYPE_KIOSK_APP: | 364 case user_manager::USER_TYPE_KIOSK_APP: |
365 return false; | 365 return false; |
366 default: | 366 default: |
367 NOTREACHED(); | 367 NOTREACHED(); |
368 } | 368 } |
369 return false; | 369 return false; |
370 } | 370 } |
371 | 371 |
372 } // namespace user_manager | 372 } // namespace user_manager |
OLD | NEW |