Chromium Code Reviews| 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..3e1d0bc4a39113e0f81b3e31b610be6bca6c8c36 100644 |
| --- a/components/omnibox/browser/omnibox_field_trial.cc |
| +++ b/components/omnibox/browser/omnibox_field_trial.cc |
| @@ -531,6 +531,49 @@ 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)) { |
|
Mark P
2016/12/22 04:58:16
nit: {} not needed
ditto below
mattreynolds
2017/01/04 01:04:03
Done.
|
| + 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 typed a query in the omnibox. |
|
Mark P
2016/12/22 04:58:16
nit: typed -> has typed
or perhaps
is typing
also
mattreynolds
2017/01/04 01:04:03
Done.
|
| + return 700; |
| +} |
| + |
| const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = |
| "OmniboxBundledExperimentV1"; |
| const char OmniboxFieldTrial::kDisableProvidersRule[] = "DisableProviders"; |
| @@ -572,6 +615,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 +645,13 @@ const char |
| OmniboxFieldTrial::kHQPExperimentalScoringTopicalityThresholdParam[] = |
| "HQPExperimentalScoringTopicalityThreshold"; |
| +const char OmniboxFieldTrial::kPhysicalWebExperimentalScoringParam[] = |
| + "PhysicalWebExperimentalScoring"; |
| +const char OmniboxFieldTrial::kPhysicalWebZeroSuggestBaseRelevanceParam[] = |
| + "PhysicalWebZeroSuggestBaseRelevance"; |
| +const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = |
| + "PhysicalWebAfterTypingBaseRelevanceParam"; |
| + |
| // static |
| int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; |