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