| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/policy/core/common/policy_loader_win.h" | 5 #include "components/policy/core/common/policy_loader_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <ntdsapi.h> // For Ds[Un]Bind | 8 #include <ntdsapi.h> // For Ds[Un]Bind |
| 9 #include <rpc.h> // For struct GUID | 9 #include <rpc.h> // For struct GUID |
| 10 #include <shlwapi.h> // For PathIsUNC() | 10 #include <shlwapi.h> // For PathIsUNC() |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 const PolicyMap::Entry* map_entry = | 106 const PolicyMap::Entry* map_entry = |
| 107 policy->Get(key::kExtensionInstallForcelist); | 107 policy->Get(key::kExtensionInstallForcelist); |
| 108 if (map_entry && map_entry->value) { | 108 if (map_entry && map_entry->value) { |
| 109 const base::ListValue* policy_list_value = NULL; | 109 const base::ListValue* policy_list_value = NULL; |
| 110 if (!map_entry->value->GetAsList(&policy_list_value)) | 110 if (!map_entry->value->GetAsList(&policy_list_value)) |
| 111 return; | 111 return; |
| 112 | 112 |
| 113 std::unique_ptr<base::ListValue> filtered_values(new base::ListValue); | 113 std::unique_ptr<base::ListValue> filtered_values(new base::ListValue); |
| 114 for (const auto& list_entry : *policy_list_value) { | 114 for (const auto& list_entry : *policy_list_value) { |
| 115 std::string entry; | 115 std::string entry; |
| 116 if (!list_entry->GetAsString(&entry)) | 116 if (!list_entry.GetAsString(&entry)) |
| 117 continue; | 117 continue; |
| 118 size_t pos = entry.find(';'); | 118 size_t pos = entry.find(';'); |
| 119 if (pos == std::string::npos) | 119 if (pos == std::string::npos) |
| 120 continue; | 120 continue; |
| 121 // Only allow custom update urls in enterprise environments. | 121 // Only allow custom update urls in enterprise environments. |
| 122 if (!base::LowerCaseEqualsASCII(entry.substr(pos), | 122 if (!base::LowerCaseEqualsASCII(entry.substr(pos), |
| 123 kExpectedWebStoreUrl)) { | 123 kExpectedWebStoreUrl)) { |
| 124 entry = kBlockedExtensionPrefix + entry; | 124 entry = kBlockedExtensionPrefix + entry; |
| 125 invalid_policies++; | 125 invalid_policies++; |
| 126 } | 126 } |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 | 620 |
| 621 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { | 621 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { |
| 622 DCHECK(object == user_policy_changed_event_.handle() || | 622 DCHECK(object == user_policy_changed_event_.handle() || |
| 623 object == machine_policy_changed_event_.handle()) | 623 object == machine_policy_changed_event_.handle()) |
| 624 << "unexpected object signaled policy reload, obj = " | 624 << "unexpected object signaled policy reload, obj = " |
| 625 << std::showbase << std::hex << object; | 625 << std::showbase << std::hex << object; |
| 626 Reload(false); | 626 Reload(false); |
| 627 } | 627 } |
| 628 | 628 |
| 629 } // namespace policy | 629 } // namespace policy |
| OLD | NEW |