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

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

Issue 2275963004: Apply default policy values also on non-ChromeOS
Patch Set: update tests 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/cloud_policy_manager.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_manager.cc b/components/policy/core/common/cloud/cloud_policy_manager.cc
index 4069e98cf6ffc491db23826dea10ddb1bebbd363..6de355e17383f2fd5c5221b3f604d189a6cfa6f5 100644
--- a/components/policy/core/common/cloud/cloud_policy_manager.cc
+++ b/components/policy/core/common/cloud/cloud_policy_manager.cc
@@ -16,6 +16,7 @@
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_switches.h"
+#include "components/policy/policy_constants.h"
#include "components/prefs/pref_service.h"
#include "net/url_request/url_request_context_getter.h"
@@ -107,6 +108,12 @@ void CloudPolicyManager::CheckAndPublishPolicy() {
void CloudPolicyManager::GetChromePolicy(PolicyMap* policy_map) {
policy_map->CopyFrom(store()->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.
+ if (store()->has_policy())
+ SetEnterpriseUsersDefaults(policy_map);
Marc Treib 2016/08/25 15:52:07 This doesn't quite match the "spec" in the bug: I'
Andrew T Wilson (Slow) 2016/08/26 07:56:50 I'm a bit concerned about this because it will now
Marc Treib 2016/08/26 09:19:19 Yup, this code duplication is what I was trying to
}
void CloudPolicyManager::CreateComponentCloudPolicyService(
« no previous file with comments | « chrome/browser/policy/cloud/cloud_policy_browsertest.cc ('k') | components/policy/tools/generate_policy_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698