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

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

Issue 22031002: Omnibox: Create DemoteByType Experiment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix include that caused android build failure Created 7 years, 4 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: 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 1ad3b16f9dd7159d05a04318deb4ee2677f2975d..7bfd2d83eeac28cf166be11879a0180206cc7405 100644
--- a/chrome/browser/omnibox/omnibox_field_trial.h
+++ b/chrome/browser/omnibox/omnibox_field_trial.h
@@ -5,16 +5,23 @@
#ifndef CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_
#define CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_
+#include <map>
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "chrome/browser/autocomplete/autocomplete_input.h"
+#include "chrome/common/autocomplete_match_type.h"
// This class manages the Omnibox field trials.
class OmniboxFieldTrial {
public:
+ // A mapping that contains multipliers indicating that matches of the
+ // specified type should have their relevance score multiplied by the
+ // given number. Omitted types are assumed to have multipliers of 1.0.
+ typedef std::map<AutocompleteMatchType::Type, float> DemotionMultipliers;
+
// Creates the static field trial groups.
// *** MUST NOT BE CALLED MORE THAN ONCE. ***
static void ActivateStaticTrials();
@@ -118,6 +125,18 @@ class OmniboxFieldTrial {
static bool SearchHistoryDisable(
AutocompleteInput::PageClassification current_page_classification);
+ // ---------------------------------------------------------
+ // For the DemoteByType experiment that's part of the bundled omnibox field
+ // trial.
+
+ // 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|.
+ static void GetDemotionsByType(
+ AutocompleteInput::PageClassification current_page_classification,
+ DemotionMultipliers* demotions_by_type);
+
private:
FRIEND_TEST_ALL_PREFIXES(OmniboxFieldTrialTest, GetValueForRuleInContext);
« 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