| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/policy/configuration_policy_provider_delegate_win.h" | 5 #include "chrome/browser/policy/configuration_policy_provider_delegate_win.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 bool ret = GetRegistryPolicyInteger(value_name, &local_result); | 133 bool ret = GetRegistryPolicyInteger(value_name, &local_result); |
| 134 if (ret) | 134 if (ret) |
| 135 *result = local_result != 0; | 135 *result = local_result != 0; |
| 136 return ret; | 136 return ret; |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool ConfigurationPolicyProviderDelegateWin::GetRegistryPolicyInteger( | 139 bool ConfigurationPolicyProviderDelegateWin::GetRegistryPolicyInteger( |
| 140 const string16& value_name, uint32* result) const { | 140 const string16& value_name, uint32* result) const { |
| 141 DWORD value = 0; | 141 DWORD value = 0; |
| 142 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); | 142 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); |
| 143 if (policy_key.ReadValueDW(value_name.c_str(), &value) == ERROR_SUCCESS) { | 143 if (policy_key.ReadValue(value_name.c_str(), &value) == ERROR_SUCCESS) { |
| 144 *result = value; | 144 *result = value; |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) == | 148 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) == |
| 149 ERROR_SUCCESS) { | 149 ERROR_SUCCESS) { |
| 150 if (policy_key.ReadValueDW(value_name.c_str(), &value) == ERROR_SUCCESS) { | 150 if (policy_key.ReadValue(value_name.c_str(), &value) == ERROR_SUCCESS) { |
| 151 *result = value; | 151 *result = value; |
| 152 return true; | 152 return true; |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 return false; | 155 return false; |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace policy | 158 } // namespace policy |
| OLD | NEW |