Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: chrome/browser/policy/configuration_policy_provider_delegate_win.cc

Issue 8344004: base/win: Add documentation to RegKey::Read/Write functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indentation Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698