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

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

Issue 11280067: Refactor SetOmahaExperimentLabel out of gcpai and into install_util. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added doc Created 8 years, 1 month 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
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/install_util.cc
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index db710d47d9f85fb116098574e5d5bca6a9f4be7f..628e44af2e7b549148e468c86b19d18644b8ee7a 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -38,6 +38,13 @@ using installer::ProductState;
namespace {
+const wchar_t* kExperimentAppGuids[] = {
+ L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}",
+ L"{8A69D345-D564-463C-AFF1-A69D9E530F96}",
+};
+
+const wchar_t kExperimentLabels[] = L"experiment_labels";
+
const wchar_t kStageBinaryPatching[] = L"binary_patching";
const wchar_t kStageBuilding[] = L"building";
const wchar_t kStageConfiguringAutoLaunch[] = L"configuring_auto_launch";
@@ -523,6 +530,27 @@ string16 InstallUtil::GetCurrentDate() {
return string16(date_str, len);
}
+// static
+bool InstallUtil::SetOmahaExperimentLabel(const string16& experiment_label,
grt (UTC plus 2) 2012/11/23 00:09:55 If this is meant to be called from the context of
+ HKEY registry_hive) {
+ size_t successful_writes = 0;
+ string16 experiment_path;
+ for (size_t i = 0; i < arraysize(kExperimentAppGuids); ++i) {
+ experiment_path = google_update::kRegPathClientState;
+ experiment_path += L"\\";
+ experiment_path += kExperimentAppGuids[i];
+
+ RegKey client_state(registry_hive, experiment_path.c_str(),
+ KEY_SET_VALUE);
+ if (client_state.WriteValue(kExperimentLabels,
+ experiment_label.c_str()) == ERROR_SUCCESS) {
+ ++successful_writes;
+ }
+ }
+
+ return (successful_writes == arraysize(kExperimentAppGuids));
+}
+
// Open |path| with minimal access to obtain information about it, returning
// true and populating |handle| on success.
// static
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698