| 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 <lm.h> // For limits. | 8 #include <lm.h> // For limits. |
| 9 #include <ntdsapi.h> // For Ds[Un]Bind | 9 #include <ntdsapi.h> // For Ds[Un]Bind |
| 10 #include <rpc.h> // For struct GUID | 10 #include <rpc.h> // For struct GUID |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 scoped_ptr<base::ListValue> filtered_values(new base::ListValue); | 149 scoped_ptr<base::ListValue> filtered_values(new base::ListValue); |
| 150 for (base::ListValue::const_iterator list_entry(policy_list_value->begin()); | 150 for (base::ListValue::const_iterator list_entry(policy_list_value->begin()); |
| 151 list_entry != policy_list_value->end(); ++list_entry) { | 151 list_entry != policy_list_value->end(); ++list_entry) { |
| 152 std::string entry; | 152 std::string entry; |
| 153 if (!(*list_entry)->GetAsString(&entry)) | 153 if (!(*list_entry)->GetAsString(&entry)) |
| 154 continue; | 154 continue; |
| 155 size_t pos = entry.find(';'); | 155 size_t pos = entry.find(';'); |
| 156 if (pos == std::string::npos) | 156 if (pos == std::string::npos) |
| 157 continue; | 157 continue; |
| 158 // Only allow custom update urls in enterprise environments. | 158 // Only allow custom update urls in enterprise environments. |
| 159 if (!LowerCaseEqualsASCII(entry.substr(pos), kExpectedWebStoreUrl)) { | 159 if (!base::LowerCaseEqualsASCII(entry.substr(pos), |
| 160 kExpectedWebStoreUrl)) { |
| 160 entry = kBlockedExtensionPrefix + entry; | 161 entry = kBlockedExtensionPrefix + entry; |
| 161 invalid_policies++; | 162 invalid_policies++; |
| 162 } | 163 } |
| 163 | 164 |
| 164 filtered_values->AppendString(entry); | 165 filtered_values->AppendString(entry); |
| 165 } | 166 } |
| 166 if (invalid_policies) { | 167 if (invalid_policies) { |
| 167 policy->Set(key::kExtensionInstallForcelist, | 168 policy->Set(key::kExtensionInstallForcelist, |
| 168 map_entry->level, map_entry->scope, | 169 map_entry->level, map_entry->scope, |
| 169 filtered_values.release(), | 170 filtered_values.release(), |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 | 684 |
| 684 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { | 685 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { |
| 685 DCHECK(object == user_policy_changed_event_.handle() || | 686 DCHECK(object == user_policy_changed_event_.handle() || |
| 686 object == machine_policy_changed_event_.handle()) | 687 object == machine_policy_changed_event_.handle()) |
| 687 << "unexpected object signaled policy reload, obj = " | 688 << "unexpected object signaled policy reload, obj = " |
| 688 << std::showbase << std::hex << object; | 689 << std::showbase << std::hex << object; |
| 689 Reload(false); | 690 Reload(false); |
| 690 } | 691 } |
| 691 | 692 |
| 692 } // namespace policy | 693 } // namespace policy |
| OLD | NEW |