| 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" |
| 11 #include "chrome/browser/chromeos/login/users/avatar/default_user_images.h" | 11 #include "chrome/browser/chromeos/login/users/avatar/default_user_images.h" |
| 12 #include "chrome/browser/chromeos/login/users/user_manager.h" | 12 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 13 #include "chromeos/login/user_names.h" |
| 13 #include "google_apis/gaia/gaia_auth_util.h" | 14 #include "google_apis/gaia/gaia_auth_util.h" |
| 14 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 16 | 17 |
| 17 namespace chromeos { | 18 namespace chromeos { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 // Returns account name portion of an email. | 22 // Returns account name portion of an email. |
| 22 std::string GetUserName(const std::string& email) { | 23 std::string GetUserName(const std::string& email) { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 RegularUser::~RegularUser() {} | 238 RegularUser::~RegularUser() {} |
| 238 | 239 |
| 239 user_manager::UserType RegularUser::GetType() const { | 240 user_manager::UserType RegularUser::GetType() const { |
| 240 return user_manager::USER_TYPE_REGULAR; | 241 return user_manager::USER_TYPE_REGULAR; |
| 241 } | 242 } |
| 242 | 243 |
| 243 bool RegularUser::CanSyncImage() const { | 244 bool RegularUser::CanSyncImage() const { |
| 244 return true; | 245 return true; |
| 245 } | 246 } |
| 246 | 247 |
| 247 GuestUser::GuestUser() : User(UserManager::kGuestUserName) { | 248 GuestUser::GuestUser() : User(chromeos::login::kGuestUserName) { |
| 248 set_display_email(std::string()); | 249 set_display_email(std::string()); |
| 249 } | 250 } |
| 250 | 251 |
| 251 GuestUser::~GuestUser() {} | 252 GuestUser::~GuestUser() {} |
| 252 | 253 |
| 253 user_manager::UserType GuestUser::GetType() const { | 254 user_manager::UserType GuestUser::GetType() const { |
| 254 return user_manager::USER_TYPE_GUEST; | 255 return user_manager::USER_TYPE_GUEST; |
| 255 } | 256 } |
| 256 | 257 |
| 257 KioskAppUser::KioskAppUser(const std::string& kiosk_app_username) | 258 KioskAppUser::KioskAppUser(const std::string& kiosk_app_username) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 273 LocallyManagedUser::~LocallyManagedUser() {} | 274 LocallyManagedUser::~LocallyManagedUser() {} |
| 274 | 275 |
| 275 user_manager::UserType LocallyManagedUser::GetType() const { | 276 user_manager::UserType LocallyManagedUser::GetType() const { |
| 276 return user_manager::USER_TYPE_LOCALLY_MANAGED; | 277 return user_manager::USER_TYPE_LOCALLY_MANAGED; |
| 277 } | 278 } |
| 278 | 279 |
| 279 std::string LocallyManagedUser::display_email() const { | 280 std::string LocallyManagedUser::display_email() const { |
| 280 return base::UTF16ToUTF8(display_name()); | 281 return base::UTF16ToUTF8(display_name()); |
| 281 } | 282 } |
| 282 | 283 |
| 283 RetailModeUser::RetailModeUser() : User(UserManager::kRetailModeUserName) { | 284 RetailModeUser::RetailModeUser() : User(chromeos::login::kRetailModeUserName) { |
| 284 set_display_email(std::string()); | 285 set_display_email(std::string()); |
| 285 } | 286 } |
| 286 | 287 |
| 287 RetailModeUser::~RetailModeUser() {} | 288 RetailModeUser::~RetailModeUser() {} |
| 288 | 289 |
| 289 user_manager::UserType RetailModeUser::GetType() const { | 290 user_manager::UserType RetailModeUser::GetType() const { |
| 290 return user_manager::USER_TYPE_RETAIL_MODE; | 291 return user_manager::USER_TYPE_RETAIL_MODE; |
| 291 } | 292 } |
| 292 | 293 |
| 293 PublicAccountUser::PublicAccountUser(const std::string& email) : User(email) { | 294 PublicAccountUser::PublicAccountUser(const std::string& email) : User(email) { |
| (...skipping 16 matching lines...) Expand all 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 |