Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7335)

Unified Diff: chrome/installer/util/google_update_settings.cc

Issue 11826028: Add a method to read the Omaha experiment_labels value. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix value Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/google_update_settings.cc
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc
index a53b61e0c6e9b9ac312e929331ff8883c397acd6..2bdc55e5b5ec78071d1756148b4505116b54514c 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -668,3 +668,23 @@ bool GoogleUpdateSettings::SetExperimentLabels(
return success;
}
+
+bool GoogleUpdateSettings::ReadExperimentLabels(
+ bool system_install,
+ string16* experiment_labels) {
+ HKEY reg_root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
+
+ // If this distribution does not set the experiment labels, don't bother
+ // reading.
+ bool success = false;
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ if (dist->ShouldSetExperimentLabels()) {
+ string16 client_state_path(
+ system_install ? dist->GetStateMediumKey() : dist->GetStateKey());
+ RegKey client_state(reg_root, client_state_path.c_str(), KEY_QUERY_VALUE);
+ success = client_state.ReadValue(google_update::kExperimentLabels,
+ experiment_labels) == ERROR_SUCCESS;
+ }
+
+ return success;
+}
« no previous file with comments | « chrome/installer/util/google_update_settings.h ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698