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

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
« no previous file with comments | « components/variations/processed_study.h ('k') | components/variations/proto/study.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/processed_study.cc
diff --git a/components/variations/processed_study.cc b/components/variations/processed_study.cc
index 9d0e4f14d512dbda40a6fda36a672a178e1257b0..944cb0296e0e7cb35c30e3f22f845969f976ea27 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,15 @@ 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,
« no previous file with comments | « components/variations/processed_study.h ('k') | components/variations/proto/study.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698