| 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" | |
| 12 #include "chrome/browser/chromeos/login/users/user_manager.h" | 11 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 13 #include "chromeos/login/user_names.h" | 12 #include "chromeos/login/user_names.h" |
| 13 #include "components/user_manager/user_image/default_user_images.h" |
| 14 #include "google_apis/gaia/gaia_auth_util.h" | 14 #include "google_apis/gaia/gaia_auth_util.h" |
| 15 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Returns account name portion of an email. | 22 // Returns account name portion of an email. |
| 23 std::string GetUserName(const std::string& email) { | 23 std::string GetUserName(const std::string& email) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 132 } |
| 133 | 133 |
| 134 std::string User::GetAccountName(bool use_display_email) const { | 134 std::string User::GetAccountName(bool use_display_email) const { |
| 135 if (use_display_email && !display_email_.empty()) | 135 if (use_display_email && !display_email_.empty()) |
| 136 return GetUserName(display_email_); | 136 return GetUserName(display_email_); |
| 137 else | 137 else |
| 138 return GetUserName(email_); | 138 return GetUserName(email_); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool User::HasDefaultImage() const { | 141 bool User::HasDefaultImage() const { |
| 142 return image_index_ >= 0 && image_index_ < kDefaultImagesCount; | 142 return image_index_ >= 0 && image_index_ < user_manager::kDefaultImagesCount; |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool User::CanSyncImage() const { | 145 bool User::CanSyncImage() const { |
| 146 return false; | 146 return false; |
| 147 } | 147 } |
| 148 | 148 |
| 149 std::string User::display_email() const { | 149 std::string User::display_email() const { |
| 150 return display_email_; | 150 return display_email_; |
| 151 } | 151 } |
| 152 | 152 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 case user_manager::USER_TYPE_SUPERVISED: | 312 case user_manager::USER_TYPE_SUPERVISED: |
| 313 case user_manager::USER_TYPE_KIOSK_APP: | 313 case user_manager::USER_TYPE_KIOSK_APP: |
| 314 return false; | 314 return false; |
| 315 default: | 315 default: |
| 316 NOTREACHED(); | 316 NOTREACHED(); |
| 317 } | 317 } |
| 318 return false; | 318 return false; |
| 319 } | 319 } |
| 320 | 320 |
| 321 } // namespace chromeos | 321 } // namespace chromeos |
| OLD | NEW |