Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Side by Side Diff: components/user_manager/user.h

Issue 718673002: New user type introduced. Combines regular and supervised features. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
81 // Returns true if user type is supervised.
82 static bool TypeIsSupervised(UserType user_type);
83
78 // Returns the user type. 84 // Returns the user type.
79 virtual UserType GetType() const = 0; 85 virtual UserType GetType() const = 0;
80 86
81 // The email the user used to log in. 87 // The email the user used to log in.
82 const std::string& email() const { return email_; } 88 const std::string& email() const { return email_; }
83 89
84 // The displayed user name. 90 // The displayed user name.
85 base::string16 display_name() const { return display_name_; } 91 base::string16 display_name() const { return display_name_; }
86 92
87 // UserInfo 93 // UserInfo
88 std::string GetEmail() const override; 94 std::string GetEmail() const override;
89 base::string16 GetDisplayName() const override; 95 base::string16 GetDisplayName() const override;
90 base::string16 GetGivenName() const override; 96 base::string16 GetGivenName() const override;
91 const gfx::ImageSkia& GetImage() const override; 97 const gfx::ImageSkia& GetImage() const override;
92 std::string GetUserID() const override; 98 std::string GetUserID() const override;
93 99
94 // Is user supervised. 100 virtual void SetIsSupervised(bool is_supervised);
Nikita (slow) 2014/11/11 12:06:36 nit: Add comment.
merkulova 2014/11/11 15:47:44 Done.
101
102 // Returns true if user is regular.
103 virtual bool IsRegular() const;
104
105 // Returns true if user is supervised.
95 virtual bool IsSupervised() const; 106 virtual bool IsSupervised() const;
96 virtual void SetIsSupervised(bool is_supervised);
97 107
98 // Returns the account name part of the email. Use the display form of the 108 // 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. 109 // email if available and use_display_name == true. Otherwise use canonical.
100 std::string GetAccountName(bool use_display_email) const; 110 std::string GetAccountName(bool use_display_email) const;
101 111
102 // Whether the user has a default image. 112 // Whether the user has a default image.
103 bool HasDefaultImage() const; 113 bool HasDefaultImage() const;
104 114
105 // True if user image can be synced. 115 // True if user image can be synced.
106 virtual bool CanSyncImage() const; 116 virtual bool CanSyncImage() const;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 282
273 DISALLOW_COPY_AND_ASSIGN(User); 283 DISALLOW_COPY_AND_ASSIGN(User);
274 }; 284 };
275 285
276 // List of known users. 286 // List of known users.
277 typedef std::vector<User*> UserList; 287 typedef std::vector<User*> UserList;
278 288
279 } // namespace user_manager 289 } // namespace user_manager
280 290
281 #endif // COMPONENTS_USER_MANAGER_USER_H_ 291 #endif // COMPONENTS_USER_MANAGER_USER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698