summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 23:47:37 +0000
committerrahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 23:47:37 +0000
commit96354fc5a07b8a41b02989946fbfbcab491a97b6 (patch)
treeea20edc6afc77d8da45d2668fae3eda8ade0268a /chrome
parent4d1dc54f98251317b8e37fa6d7f62c1710a0d775 (diff)
downloadchromium_src-96354fc5a07b8a41b02989946fbfbcab491a97b6.zip
chromium_src-96354fc5a07b8a41b02989946fbfbcab491a97b6.tar.gz
chromium_src-96354fc5a07b8a41b02989946fbfbcab491a97b6.tar.bz2
At the first run use Omaha usagestats key to determine whether to collect user metrics.
BUG=1299579 TEST=With clean profile and no "first run" file, start Chrome and make sure that Under the Hood->Help make Chrome better... option is checked or unchecked depending on whether the value of HKEY_CURRENT_USER\Software\Google\Update\ClientState\{8A69D345-D564-463c-AFF1-A69D9E530F96}\usagestats key is 1 or 0. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/google_update_settings.cc2
-rw-r--r--chrome/browser/browser.cc1
-rw-r--r--chrome/browser/browser_main.cc3
-rw-r--r--chrome/browser/views/options/advanced_contents_view.cc2
4 files changed, 5 insertions, 3 deletions
diff --git a/chrome/app/google_update_settings.cc b/chrome/app/google_update_settings.cc
index c1b06aa..eb8eb4a 100644
--- a/chrome/app/google_update_settings.cc
+++ b/chrome/app/google_update_settings.cc
@@ -46,7 +46,7 @@ bool GoogleUpdateSettings::GetCollectStatsConsent() {
RegKey key(HKEY_CURRENT_USER, kRegistryBase, KEY_READ);
DWORD value;
if (!key.ReadValueDW(kUsageStatsFlag, &value))
- return true;
+ return false;
return (1 == value);
}
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 5e4af3c..bc5ad30 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -188,7 +188,6 @@ void Browser::RegisterPrefs(PrefService* prefs) {
prefs->RegisterIntegerPref(prefs::kHungPluginDetectFrequency,
kDefaultHungPluginDetectFrequency);
prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
- prefs->RegisterBooleanPref(prefs::kMetricsReportingEnabled, true);
prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0);
}
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 21ab3ad..317ebed 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -294,6 +294,7 @@ int BrowserMain(CommandLine &parsed_command_line, int show_command,
// sources. This has to be done before uninstall code path and before prefs
// are registered.
local_state->RegisterStringPref(prefs::kApplicationLocale, L"");
+ local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled, false);
// During first run we read the google update registry key to find what
// language the user selected when downloading the installer. This
@@ -302,6 +303,8 @@ int BrowserMain(CommandLine &parsed_command_line, int show_command,
std::wstring install_lang;
if (GoogleUpdateSettings::GetLanguage(&install_lang))
local_state->SetString(prefs::kApplicationLocale, install_lang);
+ if (GoogleUpdateSettings::GetCollectStatsConsent())
+ local_state->SetBoolean(prefs::kMetricsReportingEnabled, true);
}
ResourceBundle::InitSharedInstance(
diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc
index 32359a9..52ed1df 100644
--- a/chrome/browser/views/options/advanced_contents_view.cc
+++ b/chrome/browser/views/options/advanced_contents_view.cc
@@ -467,7 +467,7 @@ void GeneralSection::NotifyPrefChanged(const std::wstring* pref_name) {
reset_file_handlers_label_->SetEnabled(enabled);
reset_file_handlers_button_->SetEnabled(enabled);
}
- if (!pref_name ||*pref_name == prefs::kMetricsReportingEnabled) {
+ if (!pref_name || *pref_name == prefs::kMetricsReportingEnabled) {
bool enabled = enable_metrics_recording_.GetValue();
bool done = g_browser_process->metrics_service()->EnableReporting(enabled);
if (!done) {