| 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 ecffd9f0fd1e12c9f5d1b4121b05f00196ebc0e4..2a42727ce9718d0cf41a0cb8ce3f05a2e24bfaaf 100644
|
| --- a/chrome/browser/omnibox/omnibox_field_trial.cc
|
| +++ b/chrome/browser/omnibox/omnibox_field_trial.cc
|
| @@ -13,13 +13,15 @@
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/time/time.h"
|
| -#include "chrome/browser/autocomplete/autocomplete_input.h"
|
| #include "chrome/browser/search/search.h"
|
| #include "chrome/common/variations/variation_ids.h"
|
| +#include "components/metrics/proto/omnibox_event.pb.h"
|
| #include "components/variations/active_field_trials.h"
|
| #include "components/variations/metrics_util.h"
|
| #include "components/variations/variations_associated_data.h"
|
|
|
| +using metrics::OmniboxEventProto;
|
| +
|
| namespace {
|
|
|
| typedef std::map<std::string, std::string> VariationParams;
|
| @@ -306,7 +308,7 @@ bool OmniboxFieldTrial::InZeroSuggestPersonalizedFieldTrial() {
|
| }
|
|
|
| bool OmniboxFieldTrial::ShortcutsScoringMaxRelevance(
|
| - AutocompleteInput::PageClassification current_page_classification,
|
| + OmniboxEventProto::PageClassification current_page_classification,
|
| int* max_relevance) {
|
| // The value of the rule is a string that encodes an integer containing
|
| // the max relevance.
|
| @@ -321,19 +323,19 @@ bool OmniboxFieldTrial::ShortcutsScoringMaxRelevance(
|
| }
|
|
|
| bool OmniboxFieldTrial::SearchHistoryPreventInlining(
|
| - AutocompleteInput::PageClassification current_page_classification) {
|
| + OmniboxEventProto::PageClassification current_page_classification) {
|
| return OmniboxFieldTrial::GetValueForRuleInContext(
|
| kSearchHistoryRule, current_page_classification) == "PreventInlining";
|
| }
|
|
|
| bool OmniboxFieldTrial::SearchHistoryDisable(
|
| - AutocompleteInput::PageClassification current_page_classification) {
|
| + OmniboxEventProto::PageClassification current_page_classification) {
|
| return OmniboxFieldTrial::GetValueForRuleInContext(
|
| kSearchHistoryRule, current_page_classification) == "Disable";
|
| }
|
|
|
| void OmniboxFieldTrial::GetDemotionsByType(
|
| - AutocompleteInput::PageClassification current_page_classification,
|
| + OmniboxEventProto::PageClassification current_page_classification,
|
| DemotionMultipliers* demotions_by_type) {
|
| demotions_by_type->clear();
|
| std::string demotion_rule = OmniboxFieldTrial::GetValueForRuleInContext(
|
| @@ -343,7 +345,7 @@ void OmniboxFieldTrial::GetDemotionsByType(
|
| // only for the fakebox-focus context.
|
| if (demotion_rule.empty() &&
|
| (current_page_classification ==
|
| - AutocompleteInput::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS))
|
| + OmniboxEventProto::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
|
| @@ -469,12 +471,12 @@ const char OmniboxFieldTrial::kHUPNewScoringVisitedCountScoreBucketsParam[] =
|
| // (kBundledExperimentFieldTrialName), each experiment group comes with a
|
| // list of parameters in the form:
|
| // key=<Rule>:
|
| -// <AutocompleteInput::PageClassification (as an int)>:
|
| +// <OmniboxEventProto::PageClassification (as an int)>:
|
| // <whether Instant Extended is enabled (as a 1 or 0)>
|
| // (note that there are no linebreaks in keys; this format is for
|
| // presentation only>
|
| // value=<arbitrary string>
|
| -// Both the AutocompleteInput::PageClassification and the Instant Extended
|
| +// Both the OmniboxEventProto::PageClassification and the Instant Extended
|
| // entries can be "*", which means this rule applies for all values of the
|
| // matching portion of the context.
|
| // One example parameter is
|
| @@ -497,7 +499,7 @@ const char OmniboxFieldTrial::kHUPNewScoringVisitedCountScoreBucketsParam[] =
|
| // and failing that it returns the empty string.
|
| std::string OmniboxFieldTrial::GetValueForRuleInContext(
|
| const std::string& rule,
|
| - AutocompleteInput::PageClassification page_classification) {
|
| + OmniboxEventProto::PageClassification page_classification) {
|
| VariationParams params;
|
| if (!chrome_variations::GetVariationParams(kBundledExperimentFieldTrialName,
|
| ¶ms)) {
|
|
|