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
[email protected]

Review URL: https://codereview.chromium.org/68503015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235527 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 161c5f8a..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::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
 }