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

Unified Diff: chrome/browser/ui/webui/settings/profile_info_handler.h

Issue 2062503002: Settings People Revamp: Add 'Manage Supervised Users' row (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: chrome/browser/ui/webui/settings/profile_info_handler.h
diff --git a/chrome/browser/ui/webui/settings/profile_info_handler.h b/chrome/browser/ui/webui/settings/profile_info_handler.h
index 4bc64054bd4bc09d38173407ad7047b8dd7e1cf2..304e256d9af3e08dc364427ffc65c66843622982 100644
--- a/chrome/browser/ui/webui/settings/profile_info_handler.h
+++ b/chrome/browser/ui/webui/settings/profile_info_handler.h
@@ -12,6 +12,7 @@
#include "build/build_config.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
+#include "components/prefs/pref_change_registrar.h"
#if defined(OS_CHROMEOS)
#include "content/public/browser/notification_observer.h"
@@ -29,6 +30,7 @@ class ProfileInfoHandler : public SettingsPageUIHandler,
public ProfileAttributesStorage::Observer {
public:
static const char kProfileInfoChangedEventName[];
+ static const char kProfileManagesSupervisedUsersChangedEventName[];
explicit ProfileInfoHandler(Profile* profile);
~ProfileInfoHandler() override;
@@ -53,12 +55,23 @@ class ProfileInfoHandler : public SettingsPageUIHandler,
private:
FRIEND_TEST_ALL_PREFIXES(ProfileInfoHandlerTest, GetProfileInfo);
FRIEND_TEST_ALL_PREFIXES(ProfileInfoHandlerTest, PushProfileInfo);
+ FRIEND_TEST_ALL_PREFIXES(ProfileInfoHandlerTest,
+ GetProfileManagesSupervisedUsers);
+ FRIEND_TEST_ALL_PREFIXES(ProfileInfoHandlerTest,
+ PushProfileManagesSupervisedUsers);
// Callbacks from the page.
void HandleGetProfileInfo(const base::ListValue* args);
+ void HandleGetProfileManagesSupervisedUsers(const base::ListValue* args);
void PushProfileInfo();
+ // Pushes whether the current profile manages supervised users to JavaScript.
+ void PushProfileManagesSupervisedUsersStatus();
+
+ // Returns true if this profile manages supervised users.
+ bool IsProfileManagingSupervisedUsers() const;
+
std::unique_ptr<base::DictionaryValue> GetAccountNameAndIcon() const;
// Weak pointer.
@@ -67,6 +80,9 @@ class ProfileInfoHandler : public SettingsPageUIHandler,
ScopedObserver<ProfileAttributesStorage, ProfileInfoHandler>
profile_observer_;
+ // Used to listen for changes in the list of managed supervised users.
+ PrefChangeRegistrar profile_pref_registrar_;
+
#if defined(OS_CHROMEOS)
// Used to listen to ChromeOS user image changes.
content::NotificationRegistrar registrar_;

Powered by Google App Engine
This is Rietveld 408576698