summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles/profile_impl.cc
diff options
context:
space:
mode:
authorknn <knn@chromium.org>2015-03-04 12:42:43 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-04 20:43:27 +0000
commit95221ffe02b9d0782202d80cf86766686afab13a (patch)
treeb29e6c1d128c70419b070a5fc3be7efc549b9f26 /chrome/browser/profiles/profile_impl.cc
parent9e621293154d1419c1e270c923237958ef70a091 (diff)
downloadchromium_src-95221ffe02b9d0782202d80cf86766686afab13a.zip
chromium_src-95221ffe02b9d0782202d80cf86766686afab13a.tar.gz
chromium_src-95221ffe02b9d0782202d80cf86766686afab13a.tar.bz2
Add a HostContentSettingsMap layer for Supervised Users.
Added a layer for Supervised Users in the HostContentSettingsMap. As this only needs functionality to block the entire content setting (for now), it is similar to the existing OverrideProvider. Reorganized the common code between the two providers. Updated the helper methods in PrefServiceBridge to check the HostContentSettingsMap instead of Preferences when checking whether it is managed by the custodian. BUG=455646 BUG=455640 Review URL: https://codereview.chromium.org/902833003 Cr-Commit-Position: refs/heads/master@{#319121}
Diffstat (limited to 'chrome/browser/profiles/profile_impl.cc')
-rw-r--r--chrome/browser/profiles/profile_impl.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index ae8aa8a..aa365dd 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -143,6 +143,7 @@
#endif
#if defined(ENABLE_SUPERVISED_USERS)
+#include "chrome/browser/content_settings/content_settings_supervised_provider.h"
#include "chrome/browser/supervised_user/supervised_user_constants.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service.h"
#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
@@ -475,7 +476,7 @@ ProfileImpl::ProfileImpl(
BrowserContextDependencyManager::GetInstance()->
RegisterProfilePrefsForServices(this, pref_registry_.get());
- SupervisedUserSettingsService* supervised_user_settings = NULL;
+ SupervisedUserSettingsService* supervised_user_settings = nullptr;
#if defined(ENABLE_SUPERVISED_USERS)
supervised_user_settings =
SupervisedUserSettingsServiceFactory::GetForProfile(this);
@@ -1040,6 +1041,15 @@ HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!host_content_settings_map_.get()) {
host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false);
+#if defined(ENABLE_SUPERVISED_USERS)
+ SupervisedUserSettingsService* supervised_user_settings =
+ SupervisedUserSettingsServiceFactory::GetForProfile(this);
+ scoped_ptr<content_settings::SupervisedProvider> supervised_provider(
+ new content_settings::SupervisedProvider(supervised_user_settings));
+ host_content_settings_map_->RegisterProvider(
+ HostContentSettingsMap::SUPERVISED_PROVIDER,
+ supervised_provider.Pass());
+#endif
}
return host_content_settings_map_.get();
}