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

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

Issue 1078713002: Supervised users: Re-check ManagementPolicy when ProfileIsSupervised changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shaving the yak Created 5 years, 8 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 6931aa07dbfdc5c78b8426f62e57f583b711ab1c..76c4288a97c1b46f832eaf287e15b51873a69699 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -56,7 +56,7 @@
#endif
#if defined(ENABLE_EXTENSIONS)
-#include "extensions/browser/extension_registry.h"
+#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_system.h"
#endif
@@ -540,6 +540,9 @@ void SupervisedUserService::SetExtensionsActive() {
management_policy->RegisterProvider(this);
else
management_policy->UnregisterProvider(this);
+
+ // Re-check the policy to make sure any new settings get applied.
+ extension_system->extension_service()->CheckManagementPolicy();
}
}
#endif // defined(ENABLE_EXTENSIONS)
@@ -761,9 +764,8 @@ void SupervisedUserService::SetActive(bool active) {
#if defined(ENABLE_THEMES)
// Re-set the default theme to turn the SU theme on/off.
ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_);
- if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme()) {
- ThemeServiceFactory::GetForProfile(profile_)->UseDefaultTheme();
- }
+ if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme())
+ theme_service->UseDefaultTheme();
#endif
ProfileSyncService* sync_service =
@@ -798,11 +800,11 @@ void SupervisedUserService::SetActive(bool active) {
whitelist_service_->Init();
UpdateManualHosts();
UpdateManualURLs();
- if (profile_->IsChild() &&
+ if (profile_->IsChild() && delegate_ &&
supervised_users::IsSafeSitesBlacklistEnabled()) {
LoadBlacklist(GetBlacklistPath(), GURL(kBlacklistURL));
}
- if (profile_->IsChild() &&
+ if (profile_->IsChild() && delegate_ &&
supervised_users::IsSafeSitesOnlineCheckEnabled()) {
url_filter_context_.InitAsyncURLChecker(profile_->GetRequestContext());
}

Powered by Google App Engine
This is Rietveld 408576698