| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_WIN_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_WIN_H_ |
| 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_WIN_H_ | 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/object_watcher.h" | 9 #include "base/object_watcher.h" |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/waitable_event.h" | 12 #include "base/waitable_event.h" |
| 13 #include "base/weak_ptr.h" | 13 #include "base/weak_ptr.h" |
| 14 #include "chrome/browser/policy/configuration_policy_store.h" | 14 #include "chrome/browser/policy/configuration_policy_store.h" |
| 15 #include "chrome/browser/policy/configuration_policy_provider.h" | 15 #include "chrome/browser/policy/configuration_policy_provider.h" |
| 16 | 16 |
| 17 namespace base { |
| 18 namespace win { |
| 17 class RegKey; | 19 class RegKey; |
| 20 } // namespace win |
| 21 } // namespace base |
| 18 | 22 |
| 19 namespace policy { | 23 namespace policy { |
| 20 | 24 |
| 21 // An implementation of |ConfigurationPolicyProvider| using the | 25 // An implementation of |ConfigurationPolicyProvider| using the |
| 22 // mechanism provided by Windows Groups Policy. Policy decisions are | 26 // mechanism provided by Windows Groups Policy. Policy decisions are |
| 23 // stored as values in a special section of the Windows Registry. | 27 // stored as values in a special section of the Windows Registry. |
| 24 // On a managed machine in a domain, this portion of the registry is | 28 // On a managed machine in a domain, this portion of the registry is |
| 25 // periodically updated by the Windows Group Policy machinery to contain | 29 // periodically updated by the Windows Group Policy machinery to contain |
| 26 // the latest version of the policy set by administrators. | 30 // the latest version of the policy set by administrators. |
| 27 class ConfigurationPolicyProviderWin | 31 class ConfigurationPolicyProviderWin |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 static const wchar_t kPolicyRegistrySubKey[]; | 96 static const wchar_t kPolicyRegistrySubKey[]; |
| 93 | 97 |
| 94 private: | 98 private: |
| 95 scoped_refptr<GroupPolicyChangeWatcher> watcher_; | 99 scoped_refptr<GroupPolicyChangeWatcher> watcher_; |
| 96 | 100 |
| 97 // Methods to perform type-specific policy lookups in the registry. | 101 // Methods to perform type-specific policy lookups in the registry. |
| 98 // HKLM is checked first, then HKCU. | 102 // HKLM is checked first, then HKCU. |
| 99 | 103 |
| 100 // Reads a string registry value |name| at the specified |key| and puts the | 104 // Reads a string registry value |name| at the specified |key| and puts the |
| 101 // resulting string in |result|. | 105 // resulting string in |result|. |
| 102 bool ReadRegistryStringValue(RegKey* key, const string16& name, | |
| 103 string16* result); | |
| 104 | 106 |
| 105 bool GetRegistryPolicyString(const string16& name, string16* result); | 107 bool GetRegistryPolicyString(const string16& name, string16* result); |
| 106 // Gets a list value contained under |key| one level below the policy root. | 108 // Gets a list value contained under |key| one level below the policy root. |
| 107 bool GetRegistryPolicyStringList(const string16& key, ListValue* result); | 109 bool GetRegistryPolicyStringList(const string16& key, ListValue* result); |
| 108 bool GetRegistryPolicyBoolean(const string16& value_name, bool* result); | 110 bool GetRegistryPolicyBoolean(const string16& value_name, bool* result); |
| 109 bool GetRegistryPolicyInteger(const string16& value_name, uint32* result); | 111 bool GetRegistryPolicyInteger(const string16& value_name, uint32* result); |
| 110 }; | 112 }; |
| 111 | 113 |
| 112 } // namespace policy | 114 } // namespace policy |
| 113 | 115 |
| 114 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_WIN_H_ | 116 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_WIN_H_ |
| OLD | NEW |