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

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

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // Returns the user type. 78 // Returns the user type.
79 virtual UserType GetType() const = 0; 79 virtual UserType GetType() const = 0;
80 80
81 // The email the user used to log in. 81 // The email the user used to log in.
82 const std::string& email() const { return email_; } 82 const std::string& email() const { return email_; }
83 83
84 // The displayed user name. 84 // The displayed user name.
85 base::string16 display_name() const { return display_name_; } 85 base::string16 display_name() const { return display_name_; }
86 86
87 // UserInfo 87 // UserInfo
88 virtual std::string GetEmail() const override; 88 std::string GetEmail() const override;
89 virtual base::string16 GetDisplayName() const override; 89 base::string16 GetDisplayName() const override;
90 virtual base::string16 GetGivenName() const override; 90 base::string16 GetGivenName() const override;
91 virtual const gfx::ImageSkia& GetImage() const override; 91 const gfx::ImageSkia& GetImage() const override;
92 virtual std::string GetUserID() const override; 92 std::string GetUserID() const override;
93 93
94 // Is user supervised. 94 // Is user supervised.
95 virtual bool IsSupervised() const; 95 virtual bool IsSupervised() const;
96 virtual void SetIsSupervised(bool is_supervised); 96 virtual void SetIsSupervised(bool is_supervised);
97 97
98 // Returns the account name part of the email. Use the display form of the 98 // 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. 99 // email if available and use_display_name == true. Otherwise use canonical.
100 std::string GetAccountName(bool use_display_email) const; 100 std::string GetAccountName(bool use_display_email) const;
101 101
102 // Whether the user has a default image. 102 // Whether the user has a default image.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 // Do not allow anyone else to create new User instances. 168 // Do not allow anyone else to create new User instances.
169 static User* CreateRegularUser(const std::string& email); 169 static User* CreateRegularUser(const std::string& email);
170 static User* CreateGuestUser(); 170 static User* CreateGuestUser();
171 static User* CreateKioskAppUser(const std::string& kiosk_app_username); 171 static User* CreateKioskAppUser(const std::string& kiosk_app_username);
172 static User* CreateSupervisedUser(const std::string& username); 172 static User* CreateSupervisedUser(const std::string& username);
173 static User* CreateRetailModeUser(); 173 static User* CreateRetailModeUser();
174 static User* CreatePublicAccountUser(const std::string& email); 174 static User* CreatePublicAccountUser(const std::string& email);
175 175
176 explicit User(const std::string& email); 176 explicit User(const std::string& email);
177 virtual ~User(); 177 ~User() override;
178 178
179 const std::string* GetAccountLocale() const { return account_locale_.get(); } 179 const std::string* GetAccountLocale() const { return account_locale_.get(); }
180 180
181 // Setters are private so only UserManager can call them. 181 // Setters are private so only UserManager can call them.
182 void SetAccountLocale(const std::string& resolved_account_locale); 182 void SetAccountLocale(const std::string& resolved_account_locale);
183 183
184 void SetImage(const UserImage& user_image, int image_index); 184 void SetImage(const UserImage& user_image, int image_index);
185 185
186 void SetImageURL(const GURL& image_url); 186 void SetImageURL(const GURL& image_url);
187 187
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 DISALLOW_COPY_AND_ASSIGN(User); 273 DISALLOW_COPY_AND_ASSIGN(User);
274 }; 274 };
275 275
276 // List of known users. 276 // List of known users.
277 typedef std::vector<User*> UserList; 277 typedef std::vector<User*> UserList;
278 278
279 } // namespace user_manager 279 } // namespace user_manager
280 280
281 #endif // COMPONENTS_USER_MANAGER_USER_H_ 281 #endif // COMPONENTS_USER_MANAGER_USER_H_
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_url_fetcher.h ('k') | components/user_prefs/user_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698