Chromium Code Reviews| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 // example, loading per-user models into memory. Having a per-user model | 57 // example, loading per-user models into memory. Having a per-user model |
| 58 // in memory allows the suggest server to respond more quickly with | 58 // in memory allows the suggest server to respond more quickly with |
| 59 // personalized suggestions as the user types. | 59 // personalized suggestions as the user types. |
| 60 const base::Feature kSearchProviderWarmUpOnFocus{ | 60 const base::Feature kSearchProviderWarmUpOnFocus{ |
| 61 "OmniboxWarmUpSearchProviderOnFocus", base::FEATURE_DISABLED_BY_DEFAULT}; | 61 "OmniboxWarmUpSearchProviderOnFocus", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 62 | 62 |
| 63 // Feature used to enable the transmission of HTTPS URLs as part of the | 63 // Feature used to enable the transmission of HTTPS URLs as part of the |
| 64 // context to the suggest server (assuming SearchProvider is permitted to | 64 // context to the suggest server (assuming SearchProvider is permitted to |
| 65 // transmit URLs for context in the first place). | 65 // transmit URLs for context in the first place). |
| 66 const base::Feature kSearchProviderContextAllowHttpsUrls{ | 66 const base::Feature kSearchProviderContextAllowHttpsUrls{ |
| 67 "OmniboixSearchProviderContextAllowHttpsUrls", | 67 "OmniboixSearchProviderContextAllowHttpsUrls", |
|
Peter Kasting
2017/05/10 20:26:34
Nit: I just noticed "omnibox" is misspelled here.
tommycli
2017/05/10 20:30:39
Done.
tommycli
2017/05/10 20:35:54
Gah, actually I can't change this, since a Finch e
| |
| 68 base::FEATURE_DISABLED_BY_DEFAULT}; | 68 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 69 | 69 |
| 70 // Feature used for the Zero Suggest Redirect to Chrome Field Trial. | 70 // Feature used for the Zero Suggest Redirect to Chrome Field Trial. |
| 71 const base::Feature kZeroSuggestRedirectToChrome{ | 71 const base::Feature kZeroSuggestRedirectToChrome{ |
| 72 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT}; | 72 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 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. |
|
Peter Kasting
2017/05/10 20:26:34
Nit: Maybe wouldn't capitalize V, M?
tommycli
2017/05/10 20:30:39
Done.
| |
| 84 const base::Feature kUIExperiments{"OmniboxUIExperiments", | 84 const base::Feature kUIExperimentVerticalMargin{ |
| 85 base::FEATURE_DISABLED_BY_DEFAULT}; | 85 "OmniboxUIExperimentVerticalMargin", base::FEATURE_DISABLED_BY_DEFAULT}; |
|
Peter Kasting
2017/05/10 20:26:34
We're not very consistent about whether to put "Om
tommycli
2017/05/10 20:30:39
I would probably advocate keeping it, since this s
Peter Kasting
2017/05/10 20:31:42
Should we add it to the things that don't have it
tommycli
2017/05/10 20:35:54
I think that would be a good thing. But would that
Peter Kasting
2017/05/10 20:43:51
Maybe? I dunno. My job as reviewer is to lob the
| |
| 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 |