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

Side by Side Diff: ceee/ie/common/ceee_module_util.cc

Issue 6321019: Fixed GetCollectStatsConsent broken by RegKey API change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « no previous file | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // CEEE module-wide utilities. 5 // CEEE module-wide utilities.
6 6
7 #include "ceee/ie/common/ceee_module_util.h" 7 #include "ceee/ie/common/ceee_module_util.h"
8 8
9 #include <iepmapi.h> 9 #include <iepmapi.h>
10 10
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // TODO(vitalybuka@google.com) : remove this code and use 296 // TODO(vitalybuka@google.com) : remove this code and use
297 // GoogleUpdateSettings::GetCollectStatsConsent() code. 297 // GoogleUpdateSettings::GetCollectStatsConsent() code.
298 // BrowserDistribution requires modification to know about CEEE (bb3136374). 298 // BrowserDistribution requires modification to know about CEEE (bb3136374).
299 bool GetCollectStatsConsent() { 299 bool GetCollectStatsConsent() {
300 std::wstring reg_path = GetCromeFrameClientStateKey(); 300 std::wstring reg_path = GetCromeFrameClientStateKey();
301 base::win::RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ); 301 base::win::RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ);
302 DWORD value = 0; 302 DWORD value = 0;
303 if (key.ReadValueDW(google_update::kRegUsageStatsField, &value) != 303 if (key.ReadValueDW(google_update::kRegUsageStatsField, &value) !=
304 ERROR_SUCCESS) { 304 ERROR_SUCCESS) {
305 base::win::RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ); 305 base::win::RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ);
306 key.ReadValueDW(google_update::kRegUsageStatsField, &value); 306 hklm_key.ReadValueDW(google_update::kRegUsageStatsField, &value);
307 } 307 }
308 308
309 return (1 == value); 309 return (1 == value);
310 } 310 }
311 311
312 bool RefreshElevationPolicyIfNeeded() { 312 bool RefreshElevationPolicyIfNeeded() {
313 if (ie_util::GetIeVersion() < ie_util::IEVERSION_IE7) 313 if (ie_util::GetIeVersion() < ie_util::IEVERSION_IE7)
314 return false; 314 return false;
315 315
316 // This may access InternetRegistry instead of real one. However this is 316 // This may access InternetRegistry instead of real one. However this is
(...skipping 18 matching lines...) Expand all
335 // Write after refreshing because it's better to refresh twice, than to miss 335 // Write after refreshing because it's better to refresh twice, than to miss
336 // once. 336 // once.
337 result = hkcu.WriteValue(kValueName, expected_version.c_str()); 337 result = hkcu.WriteValue(kValueName, expected_version.c_str());
338 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed to write a registry value: " 338 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed to write a registry value: "
339 << kValueName << " error: " << com::LogWe(result); 339 << kValueName << " error: " << com::LogWe(result);
340 340
341 return true; 341 return true;
342 } 342 }
343 343
344 } // namespace ceee_module_util 344 } // namespace ceee_module_util
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698