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

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

Issue 2716273004: Invert description and URL for experimental zero suggest suggestions. (Closed)
Patch Set: Make title/url swap an independent feature Created 3 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
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..e34d8a5dd5271a693eab324e892985e9f7e855ad 100644
--- a/components/omnibox/browser/omnibox_field_trial.cc
+++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -523,10 +523,15 @@ int OmniboxFieldTrial::KeywordScoreForSufficientlyCompleteMatch() {
OmniboxFieldTrial::EmphasizeTitlesCondition
OmniboxFieldTrial::GetEmphasizeTitlesConditionForInput(
- metrics::OmniboxInputType::Type input_type) {
+ const AutocompleteInput& input) {
// Look up the parameter named kEmphasizeTitlesRule + ":" + input_type,
Mark P 2017/02/28 22:24:28 nit: This comment no longer applies to the code.
gcomanici 2017/03/01 02:56:28 I added a comment for the condition I added, and k
// find its value, and return that value as an enum. If the parameter
// isn't redefined, fall back to the generic rule kEmphasizeTitlesRule + ":*"
+ metrics::OmniboxInputType::Type input_type = input.type();
Mark P 2017/02/28 22:24:28 nit: it's alias isn't significantly shorter or mor
gcomanici 2017/03/01 02:56:28 Done.
+ if (input.from_omnibox_focus() &&
+ OmniboxFieldTrial::InZeroSuggestSwapTitleAndUrlFieldTrial()) {
Mark P 2017/02/28 22:24:28 nit: just test directly to see if the feature is e
gcomanici 2017/03/01 02:56:28 Done.
+ return EMPHASIZE_WHEN_NONEMPTY;
+ }
std::string value_str(variations::GetVariationParamValue(
kBundledExperimentFieldTrialName,
std::string(kEmphasizeTitlesRule) + "_" +
@@ -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";

Powered by Google App Engine
This is Rietveld 408576698