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

Unified Diff: components/omnibox/omnibox_field_trial.cc

Issue 905023003: Adding knobs on HQP provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Float error fix Created 5 years, 10 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/omnibox/omnibox_field_trial.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/omnibox_field_trial.cc
diff --git a/components/omnibox/omnibox_field_trial.cc b/components/omnibox/omnibox_field_trial.cc
index 74f1100ed0f1de92c567d96db1838c272dd65f16..6dd2302fdebd84b8dccd7a6f3b0c93f87387ec8a 100644
--- a/components/omnibox/omnibox_field_trial.cc
+++ b/components/omnibox/omnibox_field_trial.cc
@@ -289,6 +289,37 @@ int OmniboxFieldTrial::HQPBookmarkValue() {
return bookmark_value;
}
+bool OmniboxFieldTrial::HQPExperimentalScoringEnabled() {
+ return variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kHQPExperimentalScoringEnabledParam) == "true";
+}
+
+std::string OmniboxFieldTrial::HQPExperimentalScoringBuckets() {
+ if (!HQPExperimentalScoringEnabled())
+ return "";
+
+ return variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kHQPExperimentalScoringBucketsParam);
+}
+
+float OmniboxFieldTrial::HQPExperimentalTopicalityThreshold() {
+ if (!HQPExperimentalScoringEnabled())
+ return -1;
+
+ std::string topicality_threhold_str =
+ variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kHQPExperimentalScoringTopicalityThresholdParam);
+
+ double topicality_threshold;
+ if (!base::StringToDouble(topicality_threhold_str, &topicality_threshold))
+ return -1;
+
+ return static_cast<float>(topicality_threshold);
+}
+
bool OmniboxFieldTrial::HQPAllowMatchInTLDValue() {
return variations::GetVariationParamValue(
kBundledExperimentFieldTrialName,
@@ -381,6 +412,14 @@ const char OmniboxFieldTrial::kHUPNewScoringVisitedCountHalfLifeTimeParam[] =
const char OmniboxFieldTrial::kHUPNewScoringVisitedCountScoreBucketsParam[] =
"VisitedCountScoreBuckets";
+const char OmniboxFieldTrial::kHQPExperimentalScoringEnabledParam[] =
+ "HQPExperimentalScoringEnabled";
+const char OmniboxFieldTrial::kHQPExperimentalScoringBucketsParam[] =
+ "HQPExperimentalScoringBuckets";
+const char
+ OmniboxFieldTrial::kHQPExperimentalScoringTopicalityThresholdParam[] =
+ "HQPExperimentalScoringTopicalityThreshold";
+
// static
int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100;
« no previous file with comments | « components/omnibox/omnibox_field_trial.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698