summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-07 13:45:52 +0000
committermpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-07 13:45:52 +0000
commit6bb380475d4dad7a293214fc04611a4d0ae071ce (patch)
tree072a7cb1c362bad307754472edbc5dc85d55fdd1
parent0dc771db12996c03b7108a6ca8090b901824889b (diff)
downloadchromium_src-6bb380475d4dad7a293214fc04611a4d0ae071ce.zip
chromium_src-6bb380475d4dad7a293214fc04611a4d0ae071ce.tar.gz
chromium_src-6bb380475d4dad7a293214fc04611a4d0ae071ce.tar.bz2
Omnibox: Launch URL Demotion in the Fakebox by Default
This has been approved for launch. BUG= Review URL: https://codereview.chromium.org/182313014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255606 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/omnibox/omnibox_field_trial.cc14
-rw-r--r--chrome/browser/omnibox/omnibox_field_trial.h3
2 files changed, 12 insertions, 5 deletions
diff --git a/chrome/browser/omnibox/omnibox_field_trial.cc b/chrome/browser/omnibox/omnibox_field_trial.cc
index 26a32c0..c7e3a1c 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
diff --git a/chrome/browser/omnibox/omnibox_field_trial.h b/chrome/browser/omnibox/omnibox_field_trial.h
index feb9f78..b6d4155 100644
--- a/chrome/browser/omnibox/omnibox_field_trial.h
+++ b/chrome/browser/omnibox/omnibox_field_trial.h
@@ -216,7 +216,8 @@ class OmniboxFieldTrial {
// If the user is in an experiment group that, in the provided
// |current_page_classification| context, demotes the relevance scores
// of certain types of matches, populates the |demotions_by_type| map
- // appropriately. Otherwise, clears |demotions_by_type|.
+ // appropriately. Otherwise, sets |demotions_by_type| to its default
+ // value based on the context.
static void GetDemotionsByType(
AutocompleteInput::PageClassification current_page_classification,
DemotionMultipliers* demotions_by_type);