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/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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 username = other.username; | 161 username = other.username; |
162 password = other.password; | 162 password = other.password; |
163 key_label = other.key_label; | 163 key_label = other.key_label; |
164 need_password_hashing = other.need_password_hashing; | 164 need_password_hashing = other.need_password_hashing; |
165 auth_code = other.auth_code; | 165 auth_code = other.auth_code; |
166 username_hash = other.username_hash; | 166 username_hash = other.username_hash; |
167 using_oauth = other.using_oauth; | 167 using_oauth = other.using_oauth; |
168 auth_flow = other.auth_flow; | 168 auth_flow = other.auth_flow; |
169 } | 169 } |
170 | 170 |
171 std::string User::GetEmail() const { | |
172 return display_email(); | |
173 } | |
174 | |
175 base::string16 User::GetGivenName() const { | |
176 return given_name_; | |
177 } | |
178 | |
179 const gfx::ImageSkia& User::GetImage() const { | |
180 return user_image_.image(); | |
181 } | |
182 | |
183 std::string User::GetID() const { | |
184 return email(); | |
185 } | |
186 | |
171 base::string16 User::GetDisplayName() const { | 187 base::string16 User::GetDisplayName() const { |
Nikita (slow)
2014/04/29 13:59:27
nit: Move this up a bit, after GetEmail()
oshima
2014/04/29 17:59:54
Done.
| |
172 // Fallback to the email account name in case display name haven't been set. | 188 // Fallback to the email account name in case display name haven't been set. |
173 return display_name_.empty() ? | 189 return display_name_.empty() ? |
174 base::UTF8ToUTF16(GetAccountName(true)) : | 190 base::UTF8ToUTF16(GetAccountName(true)) : |
175 display_name_; | 191 display_name_; |
176 } | 192 } |
177 | 193 |
178 std::string User::GetAccountName(bool use_display_email) const { | 194 std::string User::GetAccountName(bool use_display_email) const { |
179 if (use_display_email && !display_email_.empty()) | 195 if (use_display_email && !display_email_.empty()) |
180 return GetUserName(display_email_); | 196 return GetUserName(display_email_); |
181 else | 197 else |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 case USER_TYPE_LOCALLY_MANAGED: | 371 case USER_TYPE_LOCALLY_MANAGED: |
356 case USER_TYPE_KIOSK_APP: | 372 case USER_TYPE_KIOSK_APP: |
357 return false; | 373 return false; |
358 default: | 374 default: |
359 NOTREACHED(); | 375 NOTREACHED(); |
360 } | 376 } |
361 return false; | 377 return false; |
362 } | 378 } |
363 | 379 |
364 } // namespace chromeos | 380 } // namespace chromeos |
OLD | NEW |