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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 597783003: Update the AvatarMenu when a supervised user's custodian info changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ScopedObserver 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: chrome/browser/supervised_user/supervised_user_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc
index 4624863734869bf6ef7a274761201d4866635f26..6fc469c3381474a8b0f5e3e6b4b9f8349f33f198 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -194,6 +194,11 @@ bool SupervisedUserService::ProfileIsSupervised() const {
return profile_->IsSupervised();
}
+void SupervisedUserService::OnCustodianInfoChanged() {
+ FOR_EACH_OBSERVER(
+ SupervisedUserServiceObserver, observer_list_, OnCustodianInfoChanged());
+}
+
// static
void SupervisedUserService::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
@@ -723,6 +728,31 @@ void SupervisedUserService::SetActive(bool active) {
pref_change_registrar_.Add(prefs::kSupervisedUserManualURLs,
base::Bind(&SupervisedUserService::UpdateManualURLs,
base::Unretained(this)));
+ pref_change_registrar_.Add(prefs::kSupervisedUserCustodianName,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(prefs::kSupervisedUserCustodianEmail,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(prefs::kSupervisedUserCustodianProfileImageURL,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(prefs::kSupervisedUserCustodianProfileURL,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(prefs::kSupervisedUserSecondCustodianName,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(prefs::kSupervisedUserSecondCustodianEmail,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(
+ prefs::kSupervisedUserSecondCustodianProfileImageURL,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(prefs::kSupervisedUserSecondCustodianProfileURL,
+ base::Bind(&SupervisedUserService::OnCustodianInfoChanged,
+ base::Unretained(this)));
// Initialize the filter.
OnDefaultFilteringBehaviorChanged();

Powered by Google App Engine
This is Rietveld 408576698