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

Unified Diff: chrome/installer/gcapi/gcapi_omaha_experiment.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
Index: chrome/installer/gcapi/gcapi_omaha_experiment.cc
diff --git a/chrome/installer/gcapi/gcapi_omaha_experiment.cc b/chrome/installer/gcapi/gcapi_omaha_experiment.cc
index 6b4b94e74a2a951894aa6721a8bc9cf683670118..e74d001f9fe35a2bda02c0d534896d9e17496d1a 100644
--- a/chrome/installer/gcapi/gcapi_omaha_experiment.cc
+++ b/chrome/installer/gcapi/gcapi_omaha_experiment.cc
@@ -6,12 +6,10 @@
#include "base/string16.h"
#include "base/stringprintf.h"
-#include "base/string_number_conversions.h"
#include "base/time.h"
#include "base/win/registry.h"
-#include "chrome/installer/util/browser_distribution.h"
-#include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/gcapi/gcapi.h"
+#include "chrome/installer/util/install_util.h"
using base::Time;
using base::TimeDelta;
@@ -19,13 +17,6 @@ using base::win::RegKey;
namespace {
-const wchar_t kExperimentLabels[] = L"experiment_labels";
-
-const wchar_t* kExperimentAppGuids[] = {
- L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}",
- L"{8A69D345-D564-463C-AFF1-A69D9E530F96}",
-};
-
const wchar_t* kDays[] =
{ L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat" };
@@ -74,7 +65,7 @@ int GetCurrentRlzWeek() {
} // namespace
-bool SetOmahaExperimentLabel(const wchar_t* brand_code, int shell_mode) {
+bool SetGCAPIOmahaExperimentLabel(const wchar_t* brand_code, int shell_mode) {
if (!brand_code) {
return false;
}
@@ -97,21 +88,5 @@ bool SetOmahaExperimentLabel(const wchar_t* brand_code, int shell_mode) {
week_number,
BuildOmahaExperimentDateString().c_str());
- int successful_writes = 0;
- for (int i = 0; i < arraysize(kExperimentAppGuids); ++i) {
- string16 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.Valid()) {
- if (client_state.WriteValue(kExperimentLabels,
- experiment_label.c_str()) == ERROR_SUCCESS) {
- successful_writes++;
- }
- }
- }
-
- return (successful_writes == arraysize(kExperimentAppGuids));
+ return InstallUtil::SetOmahaExperimentLabel(experiment_label, registry_hive);
}

Powered by Google App Engine
This is Rietveld 408576698