| 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 UI experiments. | 83 // Feature used for the vertical margin UI experiment. |
| 84 const base::Feature kUIExperiments{"OmniboxUIExperiments", | 84 const base::Feature kUIExperimentVerticalMargin{ |
| 85 base::FEATURE_DISABLED_BY_DEFAULT}; | 85 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 86 | 86 |
| 87 } // namespace omnibox | 87 } // namespace omnibox |
| 88 | 88 |
| 89 namespace { | 89 namespace { |
| 90 | 90 |
| 91 typedef std::map<std::string, std::string> VariationParams; | 91 typedef std::map<std::string, std::string> VariationParams; |
| 92 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; | 92 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; |
| 93 | 93 |
| 94 // Field trial names. | 94 // Field trial names. |
| 95 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; | 95 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 "PhysicalWebZeroSuggestBaseRelevance"; | 733 "PhysicalWebZeroSuggestBaseRelevance"; |
| 734 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = | 734 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = |
| 735 "PhysicalWebAfterTypingBaseRelevanceParam"; | 735 "PhysicalWebAfterTypingBaseRelevanceParam"; |
| 736 | 736 |
| 737 const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] = | 737 const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] = |
| 738 "ZeroSuggestRedirectToChromeServerAddress"; | 738 "ZeroSuggestRedirectToChromeServerAddress"; |
| 739 const char | 739 const char |
| 740 OmniboxFieldTrial::kZeroSuggestRedirectToChromeAdditionalFieldsParam[] = | 740 OmniboxFieldTrial::kZeroSuggestRedirectToChromeAdditionalFieldsParam[] = |
| 741 "ZeroSuggestRedirectToChromeAdditionalFields"; | 741 "ZeroSuggestRedirectToChromeAdditionalFields"; |
| 742 | 742 |
| 743 const char OmniboxFieldTrial::kUIExperimentsVerticalMarginParam[] = | 743 const char OmniboxFieldTrial::kUIVerticalMarginParam[] = "UIVerticalMargin"; |
| 744 "UIExperimentsVerticalMargin"; | |
| 745 | 744 |
| 746 // static | 745 // static |
| 747 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; | 746 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; |
| 748 | 747 |
| 749 // Background and implementation details: | 748 // Background and implementation details: |
| 750 // | 749 // |
| 751 // Each experiment group in any field trial can come with an optional set of | 750 // Each experiment group in any field trial can come with an optional set of |
| 752 // parameters (key-value pairs). In the bundled omnibox experiment | 751 // parameters (key-value pairs). In the bundled omnibox experiment |
| 753 // (kBundledExperimentFieldTrialName), each experiment group comes with a | 752 // (kBundledExperimentFieldTrialName), each experiment group comes with a |
| 754 // list of parameters in the form: | 753 // list of parameters in the form: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 if (it != params.end()) | 800 if (it != params.end()) |
| 802 return it->second; | 801 return it->second; |
| 803 // Fall back to the global instant extended context. | 802 // Fall back to the global instant extended context. |
| 804 it = params.find(rule + ":" + page_classification_str + ":*"); | 803 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 805 if (it != params.end()) | 804 if (it != params.end()) |
| 806 return it->second; | 805 return it->second; |
| 807 // Look up rule in the global context. | 806 // Look up rule in the global context. |
| 808 it = params.find(rule + ":*:*"); | 807 it = params.find(rule + ":*:*"); |
| 809 return (it != params.end()) ? it->second : std::string(); | 808 return (it != params.end()) ? it->second : std::string(); |
| 810 } | 809 } |
| OLD | NEW |