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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 // Feature used to swap the title and URL when providing zero suggest | 75 // Feature used to swap the title and URL when providing zero suggest |
76 // suggestions. | 76 // suggestions. |
77 const base::Feature kZeroSuggestSwapTitleAndUrl{ | 77 const base::Feature kZeroSuggestSwapTitleAndUrl{ |
78 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; | 78 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; |
79 | 79 |
80 // Feature used to display the title of the current URL match. | 80 // Feature used to display the title of the current URL match. |
81 const base::Feature kDisplayTitleForCurrentUrl{ | 81 const base::Feature kDisplayTitleForCurrentUrl{ |
82 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT}; | 82 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT}; |
83 | 83 |
| 84 // Feature used for the max autocomplete matches UI experiment. |
| 85 const base::Feature kUIExperimentMaxAutocompleteMatches{ |
| 86 "OmniboxUIExperimentMaxAutocompleteMatches", |
| 87 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 88 |
84 // Feature used for the vertical margin UI experiment. | 89 // Feature used for the vertical margin UI experiment. |
85 const base::Feature kUIExperimentVerticalMargin{ | 90 const base::Feature kUIExperimentVerticalMargin{ |
86 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT}; | 91 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT}; |
87 | 92 |
88 } // namespace omnibox | 93 } // namespace omnibox |
89 | 94 |
90 namespace { | 95 namespace { |
91 | 96 |
92 typedef std::map<std::string, std::string> VariationParams; | 97 typedef std::map<std::string, std::string> VariationParams; |
93 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; | 98 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 "PhysicalWebZeroSuggestBaseRelevance"; | 759 "PhysicalWebZeroSuggestBaseRelevance"; |
755 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = | 760 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = |
756 "PhysicalWebAfterTypingBaseRelevanceParam"; | 761 "PhysicalWebAfterTypingBaseRelevanceParam"; |
757 | 762 |
758 const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] = | 763 const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] = |
759 "ZeroSuggestRedirectToChromeServerAddress"; | 764 "ZeroSuggestRedirectToChromeServerAddress"; |
760 const char | 765 const char |
761 OmniboxFieldTrial::kZeroSuggestRedirectToChromeAdditionalFieldsParam[] = | 766 OmniboxFieldTrial::kZeroSuggestRedirectToChromeAdditionalFieldsParam[] = |
762 "ZeroSuggestRedirectToChromeAdditionalFields"; | 767 "ZeroSuggestRedirectToChromeAdditionalFields"; |
763 | 768 |
| 769 const char OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam[] = |
| 770 "UIMaxAutocompleteMatches"; |
764 const char OmniboxFieldTrial::kUIVerticalMarginParam[] = "UIVerticalMargin"; | 771 const char OmniboxFieldTrial::kUIVerticalMarginParam[] = "UIVerticalMargin"; |
765 | 772 |
766 // static | 773 // static |
767 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; | 774 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; |
768 | 775 |
769 // Background and implementation details: | 776 // Background and implementation details: |
770 // | 777 // |
771 // Each experiment group in any field trial can come with an optional set of | 778 // Each experiment group in any field trial can come with an optional set of |
772 // parameters (key-value pairs). In the bundled omnibox experiment | 779 // parameters (key-value pairs). In the bundled omnibox experiment |
773 // (kBundledExperimentFieldTrialName), each experiment group comes with a | 780 // (kBundledExperimentFieldTrialName), each experiment group comes with a |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 if (it != params.end()) | 828 if (it != params.end()) |
822 return it->second; | 829 return it->second; |
823 // Fall back to the global instant extended context. | 830 // Fall back to the global instant extended context. |
824 it = params.find(rule + ":" + page_classification_str + ":*"); | 831 it = params.find(rule + ":" + page_classification_str + ":*"); |
825 if (it != params.end()) | 832 if (it != params.end()) |
826 return it->second; | 833 return it->second; |
827 // Look up rule in the global context. | 834 // Look up rule in the global context. |
828 it = params.find(rule + ":*:*"); | 835 it = params.find(rule + ":*:*"); |
829 return (it != params.end()) ? it->second : std::string(); | 836 return (it != params.end()) ? it->second : std::string(); |
830 } | 837 } |
OLD | NEW |