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

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

Issue 2710713004: Revert "Use the Windows MDM API to check if the machine is being managed." (Closed)
Patch Set: Created 3 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 | « chrome/common/crash_keys.cc ('k') | components/update_client/updater_state.h » ('j') | 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 b240c79a331d6fa08078d92d114365cd4c7e65bf..431bfc6e88621e347f787da2d2fb75d0b411f317 100644
--- a/components/policy/core/common/policy_loader_win.cc
+++ b/components/policy/core/common/policy_loader_win.cc
@@ -90,16 +90,10 @@ enum DomainCheckErrors {
DOMAIN_CHECK_ERROR_SIZE, // Not a DomainCheckError. Must be last.
};
-// Encapculates logic to determine if enterprise policies should be honored.
-// This is used in various places below.
-bool ShouldHonorPolicies() {
- return base::win::IsEnterpriseManaged();
-}
-
// Verifies that untrusted policies contain only safe values. Modifies the
// |policy| in place.
void FilterUntrustedPolicy(PolicyMap* policy) {
- if (ShouldHonorPolicies())
+ if (base::win::IsEnrolledToDomain())
return;
int invalid_policies = 0;
@@ -297,12 +291,8 @@ void CollectEnterpriseUMAs() {
base::win::OSInfo::GetInstance()->version_type(),
base::win::SUITE_LAST);
- UMA_HISTOGRAM_BOOLEAN("EnterpriseCheck.InDomain",
- base::win::IsEnrolledToDomain());
- UMA_HISTOGRAM_BOOLEAN("EnterpriseCheck.IsManaged",
- base::win::IsDeviceRegisteredWithManagement());
- UMA_HISTOGRAM_BOOLEAN("EnterpriseCheck.IsEnterpriseUser",
- base::win::IsEnterpriseManaged());
+ bool in_domain = base::win::IsEnrolledToDomain();
+ UMA_HISTOGRAM_BOOLEAN("EnterpriseCheck.InDomain", in_domain);
}
} // namespace
@@ -376,9 +366,9 @@ std::unique_ptr<PolicyBundle> PolicyLoaderWin::Load() {
{ POLICY_SCOPE_USER, HKEY_CURRENT_USER },
};
- bool honor_policies = ShouldHonorPolicies();
+ bool is_enterprise = base::win::IsEnrolledToDomain();
VLOG(1) << "Reading policy from the registry is "
- << (honor_policies ? "enabled." : "disabled.");
+ << (is_enterprise ? "enabled." : "disabled.");
// Load policy data for the different scopes/levels and merge them.
std::unique_ptr<PolicyBundle> bundle(new PolicyBundle());
@@ -406,7 +396,7 @@ std::unique_ptr<PolicyBundle> PolicyLoaderWin::Load() {
// timeout on it more aggressively. For now, there's no justification for
// the additional effort this would introduce.
- bool is_registry_forced = honor_policies || gpo_provider_ == nullptr;
+ bool is_registry_forced = is_enterprise || gpo_provider_ == nullptr;
if (is_registry_forced || !ReadPolicyFromGPO(scope, &gpo_dict, &status)) {
VLOG_IF(1, !is_registry_forced) << "Failed to read GPO files for "
<< scope << " falling back to registry.";
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | components/update_client/updater_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698