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 COMPONENTS_USER_MANAGER_USER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_H_ |
6 #define COMPONENTS_USER_MANAGER_USER_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 enum WallpaperType { | 68 enum WallpaperType { |
69 /* DAILY = 0 */ // Removed. | 69 /* DAILY = 0 */ // Removed. |
70 CUSTOMIZED = 1, // Selected by user. | 70 CUSTOMIZED = 1, // Selected by user. |
71 DEFAULT = 2, // Default. | 71 DEFAULT = 2, // Default. |
72 /* UNKNOWN = 3 */ // Removed. | 72 /* UNKNOWN = 3 */ // Removed. |
73 ONLINE = 4, // WallpaperInfo.location denotes an URL. | 73 ONLINE = 4, // WallpaperInfo.location denotes an URL. |
74 POLICY = 5, // Controlled by policy, can't be changed by the user. | 74 POLICY = 5, // Controlled by policy, can't be changed by the user. |
75 WALLPAPER_TYPE_COUNT = 6 | 75 WALLPAPER_TYPE_COUNT = 6 |
76 }; | 76 }; |
77 | 77 |
| 78 // Returns true if user type has gaia account. |
| 79 static bool TypeHasGaia(UserType user_type); |
| 80 |
78 // Returns the user type. | 81 // Returns the user type. |
79 virtual UserType GetType() const = 0; | 82 virtual UserType GetType() const = 0; |
80 | 83 |
81 // The email the user used to log in. | 84 // The email the user used to log in. |
82 const std::string& email() const { return email_; } | 85 const std::string& email() const { return email_; } |
83 | 86 |
84 // The displayed user name. | 87 // The displayed user name. |
85 base::string16 display_name() const { return display_name_; } | 88 base::string16 display_name() const { return display_name_; } |
86 | 89 |
87 // UserInfo | 90 // UserInfo |
88 std::string GetEmail() const override; | 91 std::string GetEmail() const override; |
89 base::string16 GetDisplayName() const override; | 92 base::string16 GetDisplayName() const override; |
90 base::string16 GetGivenName() const override; | 93 base::string16 GetGivenName() const override; |
91 const gfx::ImageSkia& GetImage() const override; | 94 const gfx::ImageSkia& GetImage() const override; |
92 std::string GetUserID() const override; | 95 std::string GetUserID() const override; |
93 | 96 |
94 // Is user supervised. | 97 // Allows managing supervised status of the user. Used for RegularUser. |
| 98 virtual void SetIsSupervised(bool is_supervised); |
| 99 |
| 100 // Returns true if user has gaia account. True for users of types |
| 101 // USER_TYPE_REGULAR and USER_TYPE_REGULAR_SUPERVISED. |
| 102 virtual bool HasGaiaAccount() const; |
| 103 |
| 104 // Returns true if user is supervised. |
95 virtual bool IsSupervised() const; | 105 virtual bool IsSupervised() const; |
96 virtual void SetIsSupervised(bool is_supervised); | |
97 | 106 |
98 // Returns the account name part of the email. Use the display form of the | 107 // Returns the account name part of the email. Use the display form of the |
99 // email if available and use_display_name == true. Otherwise use canonical. | 108 // email if available and use_display_name == true. Otherwise use canonical. |
100 std::string GetAccountName(bool use_display_email) const; | 109 std::string GetAccountName(bool use_display_email) const; |
101 | 110 |
102 // Whether the user has a default image. | 111 // Whether the user has a default image. |
103 bool HasDefaultImage() const; | 112 bool HasDefaultImage() const; |
104 | 113 |
105 // True if user image can be synced. | 114 // True if user image can be synced. |
106 virtual bool CanSyncImage() const; | 115 virtual bool CanSyncImage() const; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 281 |
273 DISALLOW_COPY_AND_ASSIGN(User); | 282 DISALLOW_COPY_AND_ASSIGN(User); |
274 }; | 283 }; |
275 | 284 |
276 // List of known users. | 285 // List of known users. |
277 typedef std::vector<User*> UserList; | 286 typedef std::vector<User*> UserList; |
278 | 287 |
279 } // namespace user_manager | 288 } // namespace user_manager |
280 | 289 |
281 #endif // COMPONENTS_USER_MANAGER_USER_H_ | 290 #endif // COMPONENTS_USER_MANAGER_USER_H_ |
OLD | NEW |