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

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

Issue 55413002: Don't demote top match for certain match types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Peter's comments Created 7 years, 1 month 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: chrome/browser/omnibox/omnibox_field_trial.h
diff --git a/chrome/browser/omnibox/omnibox_field_trial.h b/chrome/browser/omnibox/omnibox_field_trial.h
index 50b8701334f6903ba2efe80dcc29223238cffee9..1c9f80ef46994ffbadb4e07083f98a7978bd723b 100644
--- a/chrome/browser/omnibox/omnibox_field_trial.h
+++ b/chrome/browser/omnibox/omnibox_field_trial.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_
#include <map>
+#include <set>
#include <string>
#include <vector>
@@ -22,6 +23,9 @@ class OmniboxFieldTrial {
// given number. Omitted types are assumed to have multipliers of 1.0.
typedef std::map<AutocompleteMatchType::Type, float> DemotionMultipliers;
+ // A set of types that should not be demoted when they are the top match.
+ typedef std::set<AutocompleteMatchType::Type> UndemotableTopMatchTypes;
+
// Creates the static field trial groups.
// *** MUST NOT BE CALLED MORE THAN ONCE. ***
static void ActivateStaticTrials();
@@ -148,6 +152,11 @@ class OmniboxFieldTrial {
AutocompleteInput::PageClassification current_page_classification,
DemotionMultipliers* demotions_by_type);
+ // Get the set of types that should not be demoted if they are the top
+ // match.
+ static UndemotableTopMatchTypes GetUndemotableTopTypes(
+ AutocompleteInput::PageClassification current_page_classification);
+
// ---------------------------------------------------------
// For the ReorderForLegalDefaultMatch experiment that's part of the
// bundled omnibox field trial.
@@ -168,6 +177,7 @@ class OmniboxFieldTrial {
static const char kShortcutsScoringMaxRelevanceRule[];
static const char kSearchHistoryRule[];
static const char kDemoteByTypeRule[];
+ static const char kUndemotableTopTypeRule[];
static const char kReorderForLegalDefaultMatchRule[];
// Rule values.
static const char kReorderForLegalDefaultMatchRuleEnabled[];
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_result_unittest.cc ('k') | chrome/browser/omnibox/omnibox_field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698