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

Unified Diff: components/policy/core/common/policy_loader_win.cc

Issue 152633003: On enterprise machines read policy from the registry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split the VLOG. Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/policy_loader_win.cc
diff --git a/components/policy/core/common/policy_loader_win.cc b/components/policy/core/common/policy_loader_win.cc
index 1b190f4be1af9133e133299ded054d56b077f5cd..5c84187852734c3bc558aaef5488fa02f2e8a51a 100644
--- a/components/policy/core/common/policy_loader_win.cc
+++ b/components/policy/core/common/policy_loader_win.cc
@@ -390,6 +390,8 @@ scoped_ptr<PolicyBundle> PolicyLoaderWin::Load() {
{ POLICY_SCOPE_USER, HKEY_CURRENT_USER },
};
+ bool is_enterprise = base::win::IsEnrolledToDomain();
+
// Load policy data for the different scopes/levels and merge them.
scoped_ptr<PolicyBundle> bundle(new PolicyBundle());
PolicyMap* chrome_policy =
@@ -416,9 +418,11 @@ scoped_ptr<PolicyBundle> PolicyLoaderWin::Load() {
// timeout on it more aggressively. For now, there's no justification for
// the additional effort this would introduce.
- if (!ReadPolicyFromGPO(scope, &gpo_dict, &status)) {
- VLOG(1) << "Failed to read GPO files for " << scope
- << " falling back to registry.";
+ VLOG(1) << "Reading policy from the registry is "
+ << (is_enterprise ? "enabled." : "disabled.");
Mattias Nissler (ping if slow) 2014/02/06 10:13:57 Move this before the loop.
pastarmovj 2014/02/06 12:30:04 Done.
+ if (is_enterprise || !ReadPolicyFromGPO(scope, &gpo_dict, &status)) {
+ VLOG_IF(1, !is_enterprise) << "Failed to read GPO files for " << scope
+ << " falling back to registry.";
gpo_dict.ReadRegistry(kScopes[i].hive, chrome_policy_key_);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698