| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DELEGATE_WIN_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_DELEGATE_WIN_H_ |
| 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_DELEGATE_WIN_H_ | 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_DELEGATE_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "chrome/browser/policy/asynchronous_policy_provider.h" | 10 #include "chrome/browser/policy/asynchronous_policy_provider.h" |
| 11 #include "chrome/browser/policy/policy_map.h" | |
| 12 | 11 |
| 13 namespace policy { | 12 namespace policy { |
| 14 | 13 |
| 15 class ConfigurationPolicyProviderDelegateWin | 14 class ConfigurationPolicyProviderDelegateWin |
| 16 : public AsynchronousPolicyProvider::Delegate { | 15 : public AsynchronousPolicyProvider::Delegate { |
| 17 public: | 16 public: |
| 18 ConfigurationPolicyProviderDelegateWin( | 17 ConfigurationPolicyProviderDelegateWin( |
| 19 const PolicyDefinitionList* policy_definition_list, | 18 const PolicyDefinitionList* policy_definition_list, |
| 20 const string16& registry_key, | 19 const string16& registry_key, |
| 21 PolicyLevel level); | 20 PolicyLevel level); |
| 22 virtual ~ConfigurationPolicyProviderDelegateWin() {} | 21 virtual ~ConfigurationPolicyProviderDelegateWin() {} |
| 23 | 22 |
| 24 // AsynchronousPolicyProvider::Delegate overrides: | 23 // AsynchronousPolicyProvider::Delegate overrides: |
| 25 virtual PolicyMap* Load() OVERRIDE; | 24 virtual scoped_ptr<PolicyBundle> Load() OVERRIDE; |
| 26 | 25 |
| 27 private: | 26 private: |
| 28 // Methods to perform type-specific policy lookups in the registry. | 27 // Methods to perform type-specific policy lookups in the registry. |
| 29 // HKLM is checked first, then HKCU. | 28 // HKLM is checked first, then HKCU. |
| 30 | 29 |
| 31 // Reads a string registry value |name| at the specified |key| and puts the | 30 // Reads a string registry value |name| at the specified |key| and puts the |
| 32 // resulting string in |result|. |scope| is MACHINE for keys loaded from | 31 // resulting string in |result|. |scope| is MACHINE for keys loaded from |
| 33 // HKLM and USER for keys from HKCU. | 32 // HKLM and USER for keys from HKCU. |
| 34 bool GetRegistryPolicyString(const string16& name, | 33 bool GetRegistryPolicyString(const string16& name, |
| 35 string16* result, | 34 string16* result, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 48 const PolicyDefinitionList* policy_definition_list_; | 47 const PolicyDefinitionList* policy_definition_list_; |
| 49 const string16 registry_key_; | 48 const string16 registry_key_; |
| 50 PolicyLevel level_; | 49 PolicyLevel level_; |
| 51 | 50 |
| 52 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderDelegateWin); | 51 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderDelegateWin); |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 } // namespace policy | 54 } // namespace policy |
| 56 | 55 |
| 57 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_DELEGATE_WIN_H_ | 56 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_DELEGATE_WIN_H_ |
| OLD | NEW |