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

Unified Diff: components/omnibox/browser/omnibox_field_trial.cc

Issue 2591053002: Show PhysicalWebProvider suggestions with omnibox input (Closed)
Patch Set: enable experiment in unit tests Created 3 years, 11 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/browser/omnibox_field_trial.h ('k') | components/omnibox/browser/physical_web_node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/omnibox_field_trial.cc
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc
index 3aeff578b5fe746dad903206034bf87080b47522..b0703e36d0356b13bf3eb7873d4007cd438e0153 100644
--- a/components/omnibox/browser/omnibox_field_trial.cc
+++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -531,6 +531,47 @@ OmniboxFieldTrial::GetEmphasizeTitlesConditionForInput(
return static_cast<EmphasizeTitlesCondition>(value);
}
+// static
+bool OmniboxFieldTrial::InPhysicalWebZeroSuggestFieldTrial() {
+ return variations::GetVariationParamValue(kBundledExperimentFieldTrialName,
+ kPhysicalWebZeroSuggestRule) ==
+ "true";
+}
+
+// static
+bool OmniboxFieldTrial::InPhysicalWebAfterTypingFieldTrial() {
+ return variations::GetVariationParamValue(kBundledExperimentFieldTrialName,
+ kPhysicalWebAfterTypingRule) ==
+ "true";
+}
+
+// static
+int OmniboxFieldTrial::GetPhysicalWebZeroSuggestBaseRelevance() {
+ std::string param_value(variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kPhysicalWebZeroSuggestBaseRelevanceParam));
+ int base_relevance;
+ if (!param_value.empty() && base::StringToInt(param_value, &base_relevance))
+ return base_relevance;
+ // Default relevance score of the first Physical Web URL autocomplete match
+ // when the user has not typed in the omnibox. This score is intended to be
+ // between ClipboardURLProvider and ZeroSuggestProvider.
+ return 700;
+}
+
+// static
+int OmniboxFieldTrial::GetPhysicalWebAfterTypingBaseRelevance() {
+ std::string param_value(variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kPhysicalWebAfterTypingBaseRelevanceParam));
+ int base_relevance;
+ if (!param_value.empty() && base::StringToInt(param_value, &base_relevance))
+ return base_relevance;
+ // Default relevance score of the first Physical Web URL autocomplete match
+ // when the user is typing in the omnibox.
+ return 700;
+}
+
const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] =
"OmniboxBundledExperimentV1";
const char OmniboxFieldTrial::kDisableProvidersRule[] = "DisableProviders";
@@ -572,6 +613,10 @@ const char OmniboxFieldTrial::kKeywordRequiresPrefixMatchRule[] =
const char OmniboxFieldTrial::kKeywordScoreForSufficientlyCompleteMatchRule[] =
"KeywordScoreForSufficientlyCompleteMatch";
const char OmniboxFieldTrial::kEmphasizeTitlesRule[] = "EmphasizeTitles";
+const char OmniboxFieldTrial::kPhysicalWebZeroSuggestRule[] =
+ "PhysicalWebZeroSuggest";
+const char OmniboxFieldTrial::kPhysicalWebAfterTypingRule[] =
+ "PhysicalWebAfterTyping";
const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] =
"HUPExperimentalScoringEnabled";
@@ -598,6 +643,11 @@ const char
OmniboxFieldTrial::kHQPExperimentalScoringTopicalityThresholdParam[] =
"HQPExperimentalScoringTopicalityThreshold";
+const char OmniboxFieldTrial::kPhysicalWebZeroSuggestBaseRelevanceParam[] =
+ "PhysicalWebZeroSuggestBaseRelevance";
+const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] =
+ "PhysicalWebAfterTypingBaseRelevanceParam";
+
// static
int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100;
« no previous file with comments | « components/omnibox/browser/omnibox_field_trial.h ('k') | components/omnibox/browser/physical_web_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698