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

Unified Diff: components/policy/core/common/cloud/user_cloud_policy_manager.cc

Issue 2282743002: Disable NTP Content Suggestions by default for enterprise users (Closed)
Patch Set: GetExpectedTestPolicy calls GetExpectedDefaultPolicy Created 4 years, 4 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: components/policy/core/common/cloud/user_cloud_policy_manager.cc
diff --git a/components/policy/core/common/cloud/user_cloud_policy_manager.cc b/components/policy/core/common/cloud/user_cloud_policy_manager.cc
index f758a0db83dae62c084552dde584625787e52bf1..932fa57bf5b702564214e5e6e81cf9f524d32272 100644
--- a/components/policy/core/common/cloud/user_cloud_policy_manager.cc
+++ b/components/policy/core/common/cloud/user_cloud_policy_manager.cc
@@ -16,6 +16,7 @@
#include "components/policy/core/common/cloud/user_cloud_policy_store.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/policy/core/common/policy_types.h"
+#include "components/policy/policy_constants.h"
#include "net/url_request/url_request_context_getter.h"
namespace em = enterprise_management;
@@ -96,4 +97,23 @@ bool UserCloudPolicyManager::IsClientRegistered() const {
return client() && client()->is_registered();
}
+void UserCloudPolicyManager::GetChromePolicy(PolicyMap* policy_map) {
+ CloudPolicyManager::GetChromePolicy(policy_map);
+
+ // If the store has a verified policy blob received from the server then apply
+ // the defaults for policies that haven't been configured by the administrator
+ // given that this is an enterprise user.
+ // TODO(treib,atwilson): We should just call SetEnterpriseUsersDefaults here,
+ // see crbug.com/640950.
+ if (store()->has_policy() &&
+ !policy_map->Get(key::kNTPContentSuggestionsEnabled)) {
+ policy_map->Set(key::kNTPContentSuggestionsEnabled,
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ POLICY_SOURCE_ENTERPRISE_DEFAULT,
+ base::MakeUnique<base::FundamentalValue>(false),
+ nullptr /* external_data_fetcher */);
+ }
+}
+
} // namespace policy
« no previous file with comments | « components/policy/core/common/cloud/user_cloud_policy_manager.h ('k') | components/policy/resources/policy_templates.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698