summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/util/google_update_constants.cc1
-rw-r--r--chrome/installer/util/google_update_constants.h1
-rw-r--r--chrome/installer/util/google_update_settings.cc8
-rw-r--r--chrome/installer/util/google_update_settings.h7
4 files changed, 17 insertions, 0 deletions
diff --git a/chrome/installer/util/google_update_constants.cc b/chrome/installer/util/google_update_constants.cc
index 7b9fc2a..1c22547 100644
--- a/chrome/installer/util/google_update_constants.cc
+++ b/chrome/installer/util/google_update_constants.cc
@@ -19,6 +19,7 @@ const wchar_t kRegClientField[] = L"client";
const wchar_t kRegDidRunField[] = L"dr";
const wchar_t kRegLangField[] = L"lang";
const wchar_t kRegLastCheckedField[] = L"LastChecked";
+const wchar_t kRegMetricsId[] = L"metricsid";
const wchar_t kRegNameField[] = L"name";
const wchar_t kRegOldVersionField[] = L"opv";
const wchar_t kRegRenameCmdField[] = L"cmd";
diff --git a/chrome/installer/util/google_update_constants.h b/chrome/installer/util/google_update_constants.h
index cfb7ab1..e1458ba 100644
--- a/chrome/installer/util/google_update_constants.h
+++ b/chrome/installer/util/google_update_constants.h
@@ -27,6 +27,7 @@ extern const wchar_t kRegClientField[];
extern const wchar_t kRegDidRunField[];
extern const wchar_t kRegLangField[];
extern const wchar_t kRegLastCheckedField[];
+extern const wchar_t kRegMetricsId[];
extern const wchar_t kRegNameField[];
extern const wchar_t kRegOldVersionField[];
extern const wchar_t kRegRenameCmdField[];
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc
index 5d43ea48..3d3688b 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -67,6 +67,14 @@ bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) {
return key_hkcu.WriteValue(google_update::kRegUsageStatsField, value);
}
+bool GoogleUpdateSettings::GetMetricsId(std::wstring* metrics_id) {
+ return ReadGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id);
+}
+
+bool GoogleUpdateSettings::SetMetricsId(const std::wstring& metrics_id) {
+ return WriteGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id);
+}
+
bool GoogleUpdateSettings::SetEULAConsent(bool consented) {
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
std::wstring reg_path = dist->GetStateMediumKey();
diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h
index a4814fe7..bdc1292 100644
--- a/chrome/installer/util/google_update_settings.h
+++ b/chrome/installer/util/google_update_settings.h
@@ -23,6 +23,13 @@ class GoogleUpdateSettings {
// false if the setting could not be recorded.
static bool SetCollectStatsConsent(bool consented);
+ // Returns the metrics id set in the registry (that can be used in crash
+ // reports). If none found, returns empty string.
+ static bool GetMetricsId(std::wstring* metrics_id);
+
+ // Sets the metrics id to be used in crash reports.
+ static bool SetMetricsId(const std::wstring& metrics_id);
+
// Sets the machine-wide EULA consented flag required on OEM installs.
// Returns false if the setting could not be recorded.
static bool SetEULAConsent(bool consented);