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

Side by Side Diff: remoting/host/policy_hack/policy_watcher_win.cc

Issue 10824166: Cleaned up usage of std::wstring in src/remoting. Added presubmit warning supressions for the reman… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 4 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
« no previous file with comments | « remoting/host/plugin/daemon_installer_win.cc ('k') | remoting/host/usage_stats_consent_win.cc » ('j') | 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) 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 // 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 machine_policy_watcher_failed_ = true; 107 machine_policy_watcher_failed_ = true;
108 } 108 }
109 109
110 if (user_policy_watcher_failed_ || machine_policy_watcher_failed_) { 110 if (user_policy_watcher_failed_ || machine_policy_watcher_failed_) {
111 ScheduleFallbackReloadTask(); 111 ScheduleFallbackReloadTask();
112 } 112 }
113 } 113 }
114 114
115 bool GetRegistryPolicyString(const std::string& value_name, 115 bool GetRegistryPolicyString(const std::string& value_name,
116 std::string* result) const { 116 std::string* result) const {
117 // presubmit: allow wstring
117 std::wstring value_name_wide = UTF8ToWide(value_name); 118 std::wstring value_name_wide = UTF8ToWide(value_name);
119 // presubmit: allow wstring
118 std::wstring value; 120 std::wstring value;
119 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); 121 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ);
120 if (policy_key.ReadValue(value_name_wide.c_str(), &value) == 122 if (policy_key.ReadValue(value_name_wide.c_str(), &value) ==
121 ERROR_SUCCESS) { 123 ERROR_SUCCESS) {
122 *result = WideToUTF8(value); 124 *result = WideToUTF8(value);
123 return true; 125 return true;
124 } 126 }
125 127
126 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) == 128 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) ==
127 ERROR_SUCCESS) { 129 ERROR_SUCCESS) {
128 if (policy_key.ReadValue(value_name_wide.c_str(), &value) == 130 if (policy_key.ReadValue(value_name_wide.c_str(), &value) ==
129 ERROR_SUCCESS) { 131 ERROR_SUCCESS) {
130 *result = WideToUTF8(value); 132 *result = WideToUTF8(value);
131 return true; 133 return true;
132 } 134 }
133 } 135 }
134 return false; 136 return false;
135 } 137 }
136 138
137 bool GetRegistryPolicyInteger(const std::string& value_name, 139 bool GetRegistryPolicyInteger(const std::string& value_name,
138 uint32* result) const { 140 uint32* result) const {
141 // presubmit: allow wstring
139 std::wstring value_name_wide = UTF8ToWide(value_name); 142 std::wstring value_name_wide = UTF8ToWide(value_name);
140 DWORD value = 0; 143 DWORD value = 0;
141 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); 144 RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ);
142 if (policy_key.ReadValueDW(value_name_wide.c_str(), &value) == 145 if (policy_key.ReadValueDW(value_name_wide.c_str(), &value) ==
143 ERROR_SUCCESS) { 146 ERROR_SUCCESS) {
144 *result = value; 147 *result = value;
145 return true; 148 return true;
146 } 149 }
147 150
148 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) == 151 if (policy_key.Open(HKEY_CURRENT_USER, kRegistrySubKey, KEY_READ) ==
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 bool machine_policy_watcher_failed_; 214 bool machine_policy_watcher_failed_;
212 }; 215 };
213 216
214 PolicyWatcher* PolicyWatcher::Create( 217 PolicyWatcher* PolicyWatcher::Create(
215 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 218 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
216 return new PolicyWatcherWin(task_runner); 219 return new PolicyWatcherWin(task_runner);
217 } 220 }
218 221
219 } // namespace policy_hack 222 } // namespace policy_hack
220 } // namespace remoting 223 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/plugin/daemon_installer_win.cc ('k') | remoting/host/usage_stats_consent_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698