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

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: Rebase 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
Index: chrome/installer/util/install_util.cc
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index d98a30b5037145aefa3fcc425c4044ab3cbb8e20..bb17c095efd49f2652d6c93f169689816d3598a7 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -39,6 +39,8 @@ using installer::ProductState;
namespace {
+const wchar_t kExperimentLabels[] = L"experiment_labels";
grt (UTC plus 2) 2012/11/24 02:58:37 Since this is a value defined by Omaha, please mov
SteveT 2012/11/26 20:45:06 Done.
+
const wchar_t kStageBinaryPatching[] = L"binary_patching";
const wchar_t kStageBuilding[] = L"building";
const wchar_t kStageConfiguringAutoLaunch[] = L"configuring_auto_launch";
@@ -519,6 +521,27 @@ string16 InstallUtil::GetCurrentDate() {
return string16(date_str, len);
}
+// static
+bool InstallUtil::SetOmahaExperimentLabel(const string16& experiment_label,
grt (UTC plus 2) 2012/11/24 02:58:37 Upon further consideration, I think this belongs i
grt (UTC plus 2) 2012/11/24 03:03:44 Also, please add a test case to google_update_sett
SteveT 2012/11/26 20:45:06 Moved it.
SteveT 2012/11/26 20:45:06 Currently trying to understand the tests in google
+ bool system_install) {
+ HKEY registry_hive = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
grt (UTC plus 2) 2012/11/24 02:58:37 nit: other code in the installer uses either the n
SteveT 2012/11/26 20:45:06 Done.
+
+ // Use the browser distribution and install level to write to the correct
+ // client state/app guid key.
+ bool success = false;
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ if (dist->ShouldWriteExperimentLabels()) {
+ string16 client_state_path(
+ system_install ? dist->GetStateMediumKey() : dist->GetStateKey());
+ RegKey client_state(
+ registry_hive, client_state_path.c_str(), KEY_SET_VALUE);
+ success = client_state.WriteValue(kExperimentLabels,
grt (UTC plus 2) 2012/11/24 03:03:44 It looks like Omaha deletes the value in the regis
SteveT 2012/11/26 20:45:06 Okay, done. The return value will also represent t
+ experiment_label.c_str()) == ERROR_SUCCESS;
+ }
+
+ return success;
+}
+
// Open |path| with minimal access to obtain information about it, returning
// true and populating |handle| on success.
// static
« chrome/installer/util/install_util.h ('K') | « chrome/installer/util/install_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698