OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/omnibox/browser/omnibox_field_trial.h" | 5 #include "components/omnibox/browser/omnibox_field_trial.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 // Feature used to swap the title and URL when providing zero suggest | 74 // Feature used to swap the title and URL when providing zero suggest |
75 // suggestions. | 75 // suggestions. |
76 const base::Feature kZeroSuggestSwapTitleAndUrl{ | 76 const base::Feature kZeroSuggestSwapTitleAndUrl{ |
77 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; | 77 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; |
78 | 78 |
79 // Feature used to display the title of the current URL match. | 79 // Feature used to display the title of the current URL match. |
80 const base::Feature kDisplayTitleForCurrentUrl{ | 80 const base::Feature kDisplayTitleForCurrentUrl{ |
81 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT}; | 81 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT}; |
82 | 82 |
| 83 // Feature used for the max autocomplete matches UI experiment. |
| 84 const base::Feature kUIExperimentMaxAutocompleteMatches{ |
| 85 "OmniboxUIExperimentMaxAutocompleteMatches", |
| 86 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 87 |
83 // Feature used for the vertical margin UI experiment. | 88 // Feature used for the vertical margin UI experiment. |
84 const base::Feature kUIExperimentVerticalMargin{ | 89 const base::Feature kUIExperimentVerticalMargin{ |
85 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT}; | 90 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT}; |
86 | 91 |
87 } // namespace omnibox | 92 } // namespace omnibox |
88 | 93 |
89 namespace { | 94 namespace { |
90 | 95 |
91 typedef std::map<std::string, std::string> VariationParams; | 96 typedef std::map<std::string, std::string> VariationParams; |
92 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; | 97 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 "PhysicalWebZeroSuggestBaseRelevance"; | 738 "PhysicalWebZeroSuggestBaseRelevance"; |
734 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = | 739 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = |
735 "PhysicalWebAfterTypingBaseRelevanceParam"; | 740 "PhysicalWebAfterTypingBaseRelevanceParam"; |
736 | 741 |
737 const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] = | 742 const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] = |
738 "ZeroSuggestRedirectToChromeServerAddress"; | 743 "ZeroSuggestRedirectToChromeServerAddress"; |
739 const char | 744 const char |
740 OmniboxFieldTrial::kZeroSuggestRedirectToChromeAdditionalFieldsParam[] = | 745 OmniboxFieldTrial::kZeroSuggestRedirectToChromeAdditionalFieldsParam[] = |
741 "ZeroSuggestRedirectToChromeAdditionalFields"; | 746 "ZeroSuggestRedirectToChromeAdditionalFields"; |
742 | 747 |
| 748 const char OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam[] = |
| 749 "UIMaxAutocompleteMatches"; |
743 const char OmniboxFieldTrial::kUIVerticalMarginParam[] = "UIVerticalMargin"; | 750 const char OmniboxFieldTrial::kUIVerticalMarginParam[] = "UIVerticalMargin"; |
744 | 751 |
745 // static | 752 // static |
746 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; | 753 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; |
747 | 754 |
748 // Background and implementation details: | 755 // Background and implementation details: |
749 // | 756 // |
750 // Each experiment group in any field trial can come with an optional set of | 757 // Each experiment group in any field trial can come with an optional set of |
751 // parameters (key-value pairs). In the bundled omnibox experiment | 758 // parameters (key-value pairs). In the bundled omnibox experiment |
752 // (kBundledExperimentFieldTrialName), each experiment group comes with a | 759 // (kBundledExperimentFieldTrialName), each experiment group comes with a |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 if (it != params.end()) | 807 if (it != params.end()) |
801 return it->second; | 808 return it->second; |
802 // Fall back to the global instant extended context. | 809 // Fall back to the global instant extended context. |
803 it = params.find(rule + ":" + page_classification_str + ":*"); | 810 it = params.find(rule + ":" + page_classification_str + ":*"); |
804 if (it != params.end()) | 811 if (it != params.end()) |
805 return it->second; | 812 return it->second; |
806 // Look up rule in the global context. | 813 // Look up rule in the global context. |
807 it = params.find(rule + ":*:*"); | 814 it = params.find(rule + ":*:*"); |
808 return (it != params.end()) ? it->second : std::string(); | 815 return (it != params.end()) ? it->second : std::string(); |
809 } | 816 } |
OLD | NEW |