| 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() |
| 11 #include <stddef.h> | 11 #include <stddef.h> |
| 12 #include <userenv.h> // For GPO functions | 12 #include <userenv.h> // For GPO functions |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <string> | 15 #include <string> |
| 16 #include <utility> |
| 16 #include <vector> | 17 #include <vector> |
| 17 | 18 |
| 18 #include "base/bind.h" | 19 #include "base/bind.h" |
| 19 #include "base/files/file_util.h" | 20 #include "base/files/file_util.h" |
| 20 #include "base/json/json_reader.h" | 21 #include "base/json/json_reader.h" |
| 21 #include "base/json/json_writer.h" | 22 #include "base/json/json_writer.h" |
| 22 #include "base/lazy_instance.h" | 23 #include "base/lazy_instance.h" |
| 23 #include "base/logging.h" | 24 #include "base/logging.h" |
| 24 #include "base/macros.h" | 25 #include "base/macros.h" |
| 25 #include "base/memory/ptr_util.h" | 26 #include "base/memory/ptr_util.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 56 | 57 |
| 57 // The web store url that is the only trusted source for extensions. | 58 // The web store url that is the only trusted source for extensions. |
| 58 const char kExpectedWebStoreUrl[] = | 59 const char kExpectedWebStoreUrl[] = |
| 59 ";https://clients2.google.com/service/update2/crx"; | 60 ";https://clients2.google.com/service/update2/crx"; |
| 60 // String to be prepended to each blocked entry. | 61 // String to be prepended to each blocked entry. |
| 61 const char kBlockedExtensionPrefix[] = "[BLOCKED]"; | 62 const char kBlockedExtensionPrefix[] = "[BLOCKED]"; |
| 62 | 63 |
| 63 // List of policies that are considered only if the user is part of a AD domain. | 64 // List of policies that are considered only if the user is part of a AD domain. |
| 64 // Please document any new additions in policy_templates.json! | 65 // Please document any new additions in policy_templates.json! |
| 65 const char* kInsecurePolicies[] = { | 66 const char* kInsecurePolicies[] = { |
| 66 key::kMetricsReportingEnabled, | 67 key::kMetricsReportingEnabled, key::kDefaultSearchProviderEnabled, |
| 67 key::kDefaultSearchProviderEnabled, | 68 key::kHomepageIsNewTabPage, key::kHomepageLocation, |
| 68 key::kHomepageIsNewTabPage, | 69 key::kNewTabPageLocation, key::kRestoreOnStartup, |
| 69 key::kHomepageLocation, | 70 key::kRestoreOnStartupURLs}; |
| 70 key::kRestoreOnStartup, | |
| 71 key::kRestoreOnStartupURLs | |
| 72 }; | |
| 73 | 71 |
| 74 #pragma warning(push) | 72 #pragma warning(push) |
| 75 #pragma warning(disable: 4068) // unknown pragmas | 73 #pragma warning(disable: 4068) // unknown pragmas |
| 76 // TODO(dcheng): Remove pragma once http://llvm.org/PR24007 is fixed. | 74 // TODO(dcheng): Remove pragma once http://llvm.org/PR24007 is fixed. |
| 77 #pragma clang diagnostic ignored "-Wmissing-braces" | 75 #pragma clang diagnostic ignored "-Wmissing-braces" |
| 78 // The GUID of the registry settings group policy extension. | 76 // The GUID of the registry settings group policy extension. |
| 79 GUID kRegistrySettingsCSEGUID = REGISTRY_EXTENSION_GUID; | 77 GUID kRegistrySettingsCSEGUID = REGISTRY_EXTENSION_GUID; |
| 80 #pragma warning(pop) | 78 #pragma warning(pop) |
| 81 | 79 |
| 82 // The list of possible errors that can occur while collecting information about | 80 // The list of possible errors that can occur while collecting information about |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 | 610 |
| 613 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { | 611 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { |
| 614 DCHECK(object == user_policy_changed_event_.handle() || | 612 DCHECK(object == user_policy_changed_event_.handle() || |
| 615 object == machine_policy_changed_event_.handle()) | 613 object == machine_policy_changed_event_.handle()) |
| 616 << "unexpected object signaled policy reload, obj = " | 614 << "unexpected object signaled policy reload, obj = " |
| 617 << std::showbase << std::hex << object; | 615 << std::showbase << std::hex << object; |
| 618 Reload(false); | 616 Reload(false); |
| 619 } | 617 } |
| 620 | 618 |
| 621 } // namespace policy | 619 } // namespace policy |
| OLD | NEW |