Index: components/user_manager/user.cc |
diff --git a/components/user_manager/user.cc b/components/user_manager/user.cc |
index 575d07f589c7f4e84742d3660e3c3c58914f4117..b57d1d0db7d8a1106b9c324b28cf13c09fbe458d 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) << "Ignoring SetIsSupervised call with param " << is_supervised; |
+} |
+ |
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: |
@@ -224,7 +242,8 @@ void User::SetStubImage(const UserImage& stub_user_image, |
image_is_loading_ = is_loading; |
} |
-RegularUser::RegularUser(const std::string& email) : User(email) { |
+RegularUser::RegularUser(const std::string& email) |
+ : User(email), is_supervised_(false) { |
set_can_lock(true); |
set_display_email(email); |
} |
@@ -278,6 +297,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()); |
} |