| 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 935e2b1aa6e7617b04ad5416c91dd032fedd7e90..81452837bf14a1a621a1f13a0591edf0960f3264 100644
|
| --- a/components/omnibox/browser/omnibox_field_trial.cc
|
| +++ b/components/omnibox/browser/omnibox_field_trial.cc
|
| @@ -523,14 +523,19 @@ int OmniboxFieldTrial::KeywordScoreForSufficientlyCompleteMatch() {
|
|
|
| OmniboxFieldTrial::EmphasizeTitlesCondition
|
| OmniboxFieldTrial::GetEmphasizeTitlesConditionForInput(
|
| - metrics::OmniboxInputType::Type input_type) {
|
| - // Look up the parameter named kEmphasizeTitlesRule + ":" + input_type,
|
| + const AutocompleteInput& input) {
|
| + // First, check if we should emphasize titles for zero suggest suggestions.
|
| + if (input.from_omnibox_focus() &&
|
| + base::FeatureList::IsEnabled(features::kZeroSuggestSwapTitleAndUrl)) {
|
| + return EMPHASIZE_WHEN_NONEMPTY;
|
| + }
|
| + // Look up the parameter named kEmphasizeTitlesRule + ":" + input.type(),
|
| // find its value, and return that value as an enum. If the parameter
|
| // isn't redefined, fall back to the generic rule kEmphasizeTitlesRule + ":*"
|
| std::string value_str(variations::GetVariationParamValue(
|
| kBundledExperimentFieldTrialName,
|
| std::string(kEmphasizeTitlesRule) + "_" +
|
| - base::IntToString(static_cast<int>(input_type))));
|
| + base::IntToString(static_cast<int>(input.type()))));
|
| if (value_str.empty()) {
|
| value_str = variations::GetVariationParamValue(
|
| kBundledExperimentFieldTrialName,
|
| @@ -606,6 +611,11 @@ std::string OmniboxFieldTrial::ZeroSuggestRedirectToChromeAdditionalFields() {
|
| kZeroSuggestRedirectToChromeAdditionalFieldsParam);
|
| }
|
|
|
| +// static
|
| +bool OmniboxFieldTrial::InZeroSuggestSwapTitleAndUrlFieldTrial() {
|
| + return base::FeatureList::IsEnabled(features::kZeroSuggestSwapTitleAndUrl);
|
| +}
|
| +
|
| const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] =
|
| "OmniboxBundledExperimentV1";
|
| const char OmniboxFieldTrial::kDisableProvidersRule[] = "DisableProviders";
|
|
|