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 is regular. | |
79 static bool TypeIsRegular(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 is regular. | |
Nikita (slow)
2014/11/12 10:55:38
nit: mention that this is true for both
USER_TYPE
Nikita (slow)
2014/11/12 10:56:32
One can easily think that these checks are identic
merkulova
2014/11/12 11:01:17
Done.
bartfab (slow)
2014/11/12 16:20:25
This actually bothered me about this CL from the s
| |
101 virtual bool IsRegular() const; | |
102 | |
103 // Returns true if user is supervised. | |
95 virtual bool IsSupervised() const; | 104 virtual bool IsSupervised() const; |
96 virtual void SetIsSupervised(bool is_supervised); | |
97 | 105 |
98 // Returns the account name part of the email. Use the display form of the | 106 // 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. | 107 // email if available and use_display_name == true. Otherwise use canonical. |
100 std::string GetAccountName(bool use_display_email) const; | 108 std::string GetAccountName(bool use_display_email) const; |
101 | 109 |
102 // Whether the user has a default image. | 110 // Whether the user has a default image. |
103 bool HasDefaultImage() const; | 111 bool HasDefaultImage() const; |
104 | 112 |
105 // True if user image can be synced. | 113 // True if user image can be synced. |
106 virtual bool CanSyncImage() const; | 114 virtual bool CanSyncImage() const; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 | 280 |
273 DISALLOW_COPY_AND_ASSIGN(User); | 281 DISALLOW_COPY_AND_ASSIGN(User); |
274 }; | 282 }; |
275 | 283 |
276 // List of known users. | 284 // List of known users. |
277 typedef std::vector<User*> UserList; | 285 typedef std::vector<User*> UserList; |
278 | 286 |
279 } // namespace user_manager | 287 } // namespace user_manager |
280 | 288 |
281 #endif // COMPONENTS_USER_MANAGER_USER_H_ | 289 #endif // COMPONENTS_USER_MANAGER_USER_H_ |
OLD | NEW |