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

Unified Diff: components/variations/processed_study.cc

Issue 370463003: Add support for variations controlled overriding UI strings to the variations service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: components/variations/processed_study.cc
diff --git a/components/variations/processed_study.cc b/components/variations/processed_study.cc
index 9d0e4f14d512dbda40a6fda36a672a178e1257b0..88e572d654aad01fadc8d629934e3ea86fcf08dd 100644
--- a/components/variations/processed_study.cc
+++ b/components/variations/processed_study.cc
@@ -5,6 +5,7 @@
#include "components/variations/processed_study.h"
#include <set>
+#include <string>
#include "base/version.h"
#include "components/variations/proto/study.pb.h"
@@ -91,6 +92,16 @@ bool ProcessedStudy::Init(const Study* study, bool is_expired) {
return true;
}
+int ProcessedStudy::GetExperimentIndexByName(
+ const std::string& name) const {
+ for (int i = 0; i < study_->experiment_size(); ++i) {
+ if (study_->experiment(i).name() == name)
+ return i;
+ }
+
+ return -1;
+}
+
// static
bool ProcessedStudy::ValidateAndAppendStudy(
const Study* study,

Powered by Google App Engine
This is Rietveld 408576698