Chromium Code Reviews| 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 f6f2c2776e723ea821ddfdbe7f6f4a1c97bf6298..b15711ab52ef920aee94809485192b3af81ae17c 100644 |
| --- a/components/policy/core/common/policy_loader_win.cc |
| +++ b/components/policy/core/common/policy_loader_win.cc |
| @@ -35,6 +35,7 @@ |
| #include "base/strings/string16.h" |
| #include "base/strings/string_util.h" |
| #include "base/values.h" |
| +#include "base/win/win_util.h" |
| #include "base/win/windows_version.h" |
| #include "components/json_schema/json_schema_constants.h" |
| #include "components/policy/core/common/policy_bundle.h" |
| @@ -346,6 +347,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 = |
| @@ -372,9 +375,9 @@ 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."; |
| + if (is_enterprise || !ReadPolicyFromGPO(scope, &gpo_dict, &status)) { |
| + VLOG(1) << (!is_enterprise ? "Failed to read GPO files for " : "For ") |
| + << scope << " falling back to registry."; |
|
Mattias Nissler (ping if slow)
2014/02/05 13:23:42
This is silly. Just turn the log message into:
VL
pastarmovj
2014/02/05 14:05:45
The idea was to achieve both with one go :)
|
| gpo_dict.ReadRegistry(kScopes[i].hive, chrome_policy_key_); |
| } |