diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-21 02:10:20 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-21 02:10:20 +0000 |
commit | 1b83d81c2e7db94aad8fd203ea33d50f1d3fb6dc (patch) | |
tree | 844b40829ed2470e11425ce54f99d53d554f8ad9 /chrome/installer | |
parent | 26957bf15e0f8344b97f6e7f8e22c7cd8fa70a4d (diff) | |
download | chromium_src-1b83d81c2e7db94aad8fd203ea33d50f1d3fb6dc.zip chromium_src-1b83d81c2e7db94aad8fd203ea33d50f1d3fb6dc.tar.gz chromium_src-1b83d81c2e7db94aad8fd203ea33d50f1d3fb6dc.tar.bz2 |
Write usagestats to HKLM as well
- future crash reporter will use this key
BUG=1459941
Review URL: http://codereview.chromium.org/42407
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/util/google_update_settings.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index 8da8adc..326a595 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -52,9 +52,15 @@ bool GoogleUpdateSettings::GetCollectStatsConsent() { } bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) { - std::wstring reg_path = GetClientStateKeyPath(false); - RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ | KEY_WRITE); - return key.WriteValue(google_update::kRegUsageStatsField, consented? 1 : 0); + DWORD value = consented? 1 : 0; + // Writing to HKLM is only a best effort deal. + std::wstring reg_path = GetClientStateKeyPath(true); + RegKey key_hklm(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ | KEY_WRITE); + key_hklm.WriteValue(google_update::kRegUsageStatsField, value); + // Writing to HKCU is used both by chrome and by the crash reporter. + reg_path = GetClientStateKeyPath(false); + RegKey key_hkcu(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ | KEY_WRITE); + return key_hkcu.WriteValue(google_update::kRegUsageStatsField, value); } bool GoogleUpdateSettings::SetEULAConsent(bool consented) { |