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

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

Issue 182313014: Omnibox: Launch URL Demotion in the Fakebox by Default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « chrome/browser/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: chrome/browser/omnibox/omnibox_field_trial.cc
diff --git a/chrome/browser/omnibox/omnibox_field_trial.cc b/chrome/browser/omnibox/omnibox_field_trial.cc
index 26a32c07aa927140c1abee07d87473db89f8aef3..c7e3a1c0e755d863dd60e85db7824d3d3eceab09 100644
--- a/chrome/browser/omnibox/omnibox_field_trial.cc
+++ b/chrome/browser/omnibox/omnibox_field_trial.cc
@@ -322,10 +322,16 @@ void OmniboxFieldTrial::GetDemotionsByType(
AutocompleteInput::PageClassification current_page_classification,
DemotionMultipliers* demotions_by_type) {
demotions_by_type->clear();
- const std::string demotion_rule =
- OmniboxFieldTrial::GetValueForRuleInContext(
- kDemoteByTypeRule,
- current_page_classification);
+ std::string demotion_rule = OmniboxFieldTrial::GetValueForRuleInContext(
+ kDemoteByTypeRule, current_page_classification);
+ // If there is no demotion rule for this context, then use the default
+ // value for that context. At the moment the default value is non-empty
+ // only for the fakebox-focus context.
+ if (demotion_rule.empty() &&
+ (current_page_classification ==
+ AutocompleteInput::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS))
+ demotion_rule = "1:61,2:61,3:61,4:61,12:61";
+
// The value of the DemoteByType rule is a comma-separated list of
// {ResultType + ":" + Number} where ResultType is an AutocompleteMatchType::
// Type enum represented as an integer and Number is an integer number
« no previous file with comments | « chrome/browser/omnibox/omnibox_field_trial.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698