From a178ed29bc50573f019998272f045683a66ea68f Mon Sep 17 00:00:00 2001 From: "joaodasilva@chromium.org" Date: Sun, 17 Nov 2013 15:55:39 +0000 Subject: Fix the observer of the kMetricsReportingEnabled pref. This observer makes sure that the "Consent To Send Stats" file follows the value of the kMetricsReportingEnabled pref, which can be configured by the user or by management policy. However, OptionsUtil::ResolveMetricsReportingEnabled also Starts/Stops the MetricsService but it should never start under some conditions (e.g. on non-official builds). This fix calls GoogleUpdateSettings::SetCollectStatsConsent directly to update the state of the file, without changing the current state of the MetricsService. BUG=318761 R=jochen@chromium.org Review URL: https://codereview.chromium.org/68503015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235527 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_process_impl.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'chrome/browser/browser_process_impl.cc') diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 161c5f8..5db8e49 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -110,7 +110,6 @@ #if !defined(OS_ANDROID) && !defined(OS_IOS) #include "chrome/browser/media_galleries/media_file_system_registry.h" -#include "chrome/browser/ui/options/options_util.h" #endif #if defined(ENABLE_PLUGIN_INSTALLATION) @@ -1041,8 +1040,11 @@ void BrowserProcessImpl::ApplyAllowCrossOriginAuthPromptPolicy() { void BrowserProcessImpl::ApplyMetricsReportingPolicy() { #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) - OptionsUtil::ResolveMetricsReportingEnabled( - local_state()->GetBoolean(prefs::kMetricsReportingEnabled)); + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, + base::Bind( + base::IgnoreResult(&GoogleUpdateSettings::SetCollectStatsConsent), + local_state()->GetBoolean(prefs::kMetricsReportingEnabled))); #endif } -- cgit v1.1