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

Unified Diff: components/user_manager/user.cc

Issue 561713002: ash: Add checks for supervised users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed child class updated. Checks improved. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/user_manager/user.cc
diff --git a/components/user_manager/user.cc b/components/user_manager/user.cc
index 575d07f589c7f4e84742d3660e3c3c58914f4117..139f550ada3b1583e12541a2662423753b549430 100644
--- a/components/user_manager/user.cc
+++ b/components/user_manager/user.cc
@@ -28,6 +28,14 @@ std::string GetUserName(const std::string& email) {
} // namespace
+bool User::IsSupervised() const {
+ return false;
+}
+
+void User::SetIsSupervised(bool is_supervised) {
+ VLOG(1) << "Setting user is supervised to " << is_supervised;
Marc Treib 2014/09/15 08:20:51 I just noticed: I think this should say something
merkulova 2014/09/18 08:51:29 Done.
+}
+
class RegularUser : public User {
public:
explicit RegularUser(const std::string& email);
@@ -36,8 +44,17 @@ class RegularUser : public User {
// Overridden from User:
virtual UserType GetType() const OVERRIDE;
virtual bool CanSyncImage() const OVERRIDE;
+ virtual void SetIsSupervised(bool is_supervised) OVERRIDE {
+ VLOG(1) << "Setting user is supervised to " << is_supervised;
+ is_supervised_ = is_supervised;
+ }
+ virtual bool IsSupervised() const OVERRIDE {
+ return is_supervised_;
+ }
private:
+ bool is_supervised_;
+
DISALLOW_COPY_AND_ASSIGN(RegularUser);
};
@@ -72,6 +89,7 @@ class SupervisedUser : public User {
// Overridden from User:
virtual UserType GetType() const OVERRIDE;
+ virtual bool IsSupervised() const OVERRIDE;
virtual std::string display_email() const OVERRIDE;
private:
@@ -278,6 +296,10 @@ std::string SupervisedUser::display_email() const {
return base::UTF16ToUTF8(display_name());
}
+bool SupervisedUser::IsSupervised() const {
+ return true;
+}
+
RetailModeUser::RetailModeUser() : User(chromeos::login::kRetailModeUserName) {
set_display_email(std::string());
}

Powered by Google App Engine
This is Rietveld 408576698