Index: components/dom_distiller/core/experiments.cc |
diff --git a/components/dom_distiller/core/experiments.cc b/components/dom_distiller/core/experiments.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..69af17b4e1d2f4d2c2d56b811abd8690903b4222 |
--- /dev/null |
+++ b/components/dom_distiller/core/experiments.cc |
@@ -0,0 +1,20 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/dom_distiller/core/experiments.h" |
+ |
+#include "base/metrics/field_trial.h" |
+ |
+namespace dom_distiller { |
+DistillerHeuristicsType GetDistillerHeuristicsType() { |
nyquist
2015/04/01 18:17:01
Should this check the flags as well? Or is that so
cjhopman
2015/04/01 19:22:54
That's implicit field trial magic. Adding the flag
cjhopman
2015/04/01 21:06:20
I've added explicitly checking the flags though wh
|
+ const std::string group_name = |
+ base::FieldTrialList::FindFullName("ReaderModeUI"); |
+ if (group_name == "OGArticle" || group_name == "ForcedOGArticle") { |
+ return DistillerHeuristicsType::OG_ARTICLE; |
+ } else if (group_name == "AdaBoost" || group_name == "ForcedAdaBoost") { |
+ return DistillerHeuristicsType::ADABOOST_MODEL; |
+ } |
+ return DistillerHeuristicsType::NONE; |
+} |
+} |