| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/session/user_info.h" | |
| 12 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 13 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/chromeos/login/users/avatar/user_image.h" | 13 #include "chrome/browser/chromeos/login/users/avatar/user_image.h" |
| 14 #include "components/user_manager/user_info.h" |
| 15 #include "components/user_manager/user_type.h" | 15 #include "components/user_manager/user_type.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 #include "ui/gfx/image/image_skia.h" | 17 #include "ui/gfx/image/image_skia.h" |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 extern const int kDefaultImagesCount; | 21 extern const int kDefaultImagesCount; |
| 22 | 22 |
| 23 // A class representing information about a previously logged in user. | 23 // A class representing information about a previously logged in user. |
| 24 // Each user has a canonical email (username), returned by |email()| and | 24 // Each user has a canonical email (username), returned by |email()| and |
| 25 // may have a different displayed email (in the raw form as entered by user), | 25 // may have a different displayed email (in the raw form as entered by user), |
| 26 // returned by |displayed_email()|. | 26 // returned by |displayed_email()|. |
| 27 // Displayed emails are for use in UI only, anywhere else users must be referred | 27 // Displayed emails are for use in UI only, anywhere else users must be referred |
| 28 // to by |email()|. | 28 // to by |email()|. |
| 29 class User : public ash::UserInfo { | 29 class User : public user_manager::UserInfo { |
| 30 public: | 30 public: |
| 31 // User OAuth token status according to the last check. | 31 // User OAuth token status according to the last check. |
| 32 // Please note that enum values 1 and 2 were used for OAuth1 status and are | 32 // Please note that enum values 1 and 2 were used for OAuth1 status and are |
| 33 // deprecated now. | 33 // deprecated now. |
| 34 typedef enum { | 34 typedef enum { |
| 35 OAUTH_TOKEN_STATUS_UNKNOWN = 0, | 35 OAUTH_TOKEN_STATUS_UNKNOWN = 0, |
| 36 OAUTH2_TOKEN_STATUS_INVALID = 3, | 36 OAUTH2_TOKEN_STATUS_INVALID = 3, |
| 37 OAUTH2_TOKEN_STATUS_VALID = 4, | 37 OAUTH2_TOKEN_STATUS_VALID = 4, |
| 38 } OAuthTokenStatus; | 38 } OAuthTokenStatus; |
| 39 | 39 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 56 | 56 |
| 57 // Returns the user type. | 57 // Returns the user type. |
| 58 virtual user_manager::UserType GetType() const = 0; | 58 virtual user_manager::UserType GetType() const = 0; |
| 59 | 59 |
| 60 // The email the user used to log in. | 60 // The email the user used to log in. |
| 61 const std::string& email() const { return email_; } | 61 const std::string& email() const { return email_; } |
| 62 | 62 |
| 63 // The displayed user name. | 63 // The displayed user name. |
| 64 base::string16 display_name() const { return display_name_; } | 64 base::string16 display_name() const { return display_name_; } |
| 65 | 65 |
| 66 // ash::UserInfo | 66 // user_manager::UserInfo |
| 67 virtual std::string GetEmail() const OVERRIDE; | 67 virtual std::string GetEmail() const OVERRIDE; |
| 68 virtual base::string16 GetDisplayName() const OVERRIDE; | 68 virtual base::string16 GetDisplayName() const OVERRIDE; |
| 69 virtual base::string16 GetGivenName() const OVERRIDE; | 69 virtual base::string16 GetGivenName() const OVERRIDE; |
| 70 virtual const gfx::ImageSkia& GetImage() const OVERRIDE; | 70 virtual const gfx::ImageSkia& GetImage() const OVERRIDE; |
| 71 virtual std::string GetUserID() const OVERRIDE; | 71 virtual std::string GetUserID() const OVERRIDE; |
| 72 | 72 |
| 73 // Returns the account name part of the email. Use the display form of the | 73 // Returns the account name part of the email. Use the display form of the |
| 74 // email if available and use_display_name == true. Otherwise use canonical. | 74 // email if available and use_display_name == true. Otherwise use canonical. |
| 75 std::string GetAccountName(bool use_display_email) const; | 75 std::string GetAccountName(bool use_display_email) const; |
| 76 | 76 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 260 |
| 261 DISALLOW_COPY_AND_ASSIGN(User); | 261 DISALLOW_COPY_AND_ASSIGN(User); |
| 262 }; | 262 }; |
| 263 | 263 |
| 264 // List of known users. | 264 // List of known users. |
| 265 typedef std::vector<User*> UserList; | 265 typedef std::vector<User*> UserList; |
| 266 | 266 |
| 267 } // namespace chromeos | 267 } // namespace chromeos |
| 268 | 268 |
| 269 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_H_ | 269 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_H_ |
| OLD | NEW |