Chromium Code Reviews| Index: chrome/installer/setup/installer_crash_reporter_client.cc |
| diff --git a/chrome/installer/setup/installer_crash_reporter_client.cc b/chrome/installer/setup/installer_crash_reporter_client.cc |
| index 3d9cd9a5266834244234bf09094a31316ab64d10..418e901d337154a53fa5bf3a2ff58ee63c96ab5d 100644 |
| --- a/chrome/installer/setup/installer_crash_reporter_client.cc |
| +++ b/chrome/installer/setup/installer_crash_reporter_client.cc |
| @@ -14,7 +14,9 @@ |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_version.h" |
| #include "chrome/common/env_vars.h" |
| +#include "chrome/install_static/install_util.h" |
| #include "chrome/installer/setup/installer_crash_reporting.h" |
| +#include "chrome/installer/util/browser_distribution.h" |
| #include "chrome/installer/util/google_update_settings.h" |
| InstallerCrashReporterClient::InstallerCrashReporterClient( |
| @@ -123,6 +125,20 @@ bool InstallerCrashReporterClient::GetCollectStatsConsent() { |
| #endif |
| } |
| +bool InstallerCrashReporterClient::GetCollectStatsInSample() { |
| + // TODO(grt): remove duplication of code. |
| + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| + base::win::RegKey key(HKEY_CURRENT_USER, dist->GetRegistryPath().c_str(), |
| + KEY_QUERY_VALUE | KEY_WOW64_32KEY); |
| + if (!key.Valid()) |
| + return true; |
| + DWORD out_value = 0; |
| + if (key.ReadValueDW(install_static::kRegValueChromeStatsSample, &out_value) != |
| + ERROR_SUCCESS) |
|
grt (UTC plus 2)
2016/10/25 06:58:31
nit: braces around the body since the conditional
jwd
2016/10/25 20:36:45
Done.
|
| + return true; |
| + return out_value == 1; |
| +} |
| + |
| bool InstallerCrashReporterClient::ReportingIsEnforcedByPolicy(bool* enabled) { |
| // From the generated policy/policy/policy_constants.cc: |
| #if defined(GOOGLE_CHROME_BUILD) |