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

Side by Side Diff: remoting/host/plugin/policy_hack/nat_policy_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
« base/win/registry.h ('K') | « chrome_frame/utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Most of this code is copied from various classes in 5 // Most of this code is copied from various classes in
6 // src/chrome/browser/policy. In particular, look at 6 // src/chrome/browser/policy. In particular, look at
7 // 7 //
8 // configuration_policy_provider_delegate_win.{h,cc} 8 // configuration_policy_provider_delegate_win.{h,cc}
9 // configuration_policy_loader_win.{h,cc} 9 // configuration_policy_loader_win.{h,cc}
10 // 10 //
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 if (user_policy_watcher_failed_ || machine_policy_watcher_failed_) { 109 if (user_policy_watcher_failed_ || machine_policy_watcher_failed_) {
110 ScheduleFallbackReloadTask(); 110 ScheduleFallbackReloadTask();
111 } 111 }
112 } 112 }
113 113
114 bool GetRegistryPolicyInteger(const string16& value_name, 114 bool GetRegistryPolicyInteger(const string16& value_name,
115 uint32* result) const { 115 uint32* result) const {
116 DWORD value = 0; 116 DWORD value = 0;
117 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); 117 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ);
118 if (policy_key.ReadValueDW(value_name.c_str(), &value) == ERROR_SUCCESS) { 118 if (policy_key.ReadValue(value_name.c_str(), &value) == ERROR_SUCCESS) {
119 *result = value; 119 *result = value;
120 return true; 120 return true;
121 } 121 }
122 122
123 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) == 123 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) ==
124 ERROR_SUCCESS) { 124 ERROR_SUCCESS) {
125 if (policy_key.ReadValueDW(value_name.c_str(), &value) == ERROR_SUCCESS) { 125 if (policy_key.ReadValue(value_name.c_str(), &value) == ERROR_SUCCESS) {
126 *result = value; 126 *result = value;
127 return true; 127 return true;
128 } 128 }
129 } 129 }
130 return false; 130 return false;
131 } 131 }
132 132
133 bool GetRegistryPolicyBoolean(const string16& value_name, 133 bool GetRegistryPolicyBoolean(const string16& value_name,
134 bool* result) const { 134 bool* result) const {
135 uint32 local_result = 0; 135 uint32 local_result = 0;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 bool user_policy_watcher_failed_; 176 bool user_policy_watcher_failed_;
177 bool machine_policy_watcher_failed_; 177 bool machine_policy_watcher_failed_;
178 }; 178 };
179 179
180 NatPolicy* NatPolicy::Create(base::MessageLoopProxy* message_loop_proxy) { 180 NatPolicy* NatPolicy::Create(base::MessageLoopProxy* message_loop_proxy) {
181 return new NatPolicyWin(message_loop_proxy); 181 return new NatPolicyWin(message_loop_proxy);
182 } 182 }
183 183
184 } // namespace policy_hack 184 } // namespace policy_hack
185 } // namespace remoting 185 } // namespace remoting
OLDNEW
« base/win/registry.h ('K') | « chrome_frame/utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698