Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: components/omnibox/browser/omnibox_field_trial.cc

Issue 2965173002: Add ContextualSuggestionsService to Omnibox (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const base::Feature kSearchProviderWarmUpOnFocus{ 78 const base::Feature kSearchProviderWarmUpOnFocus{
79 "OmniboxWarmUpSearchProviderOnFocus", base::FEATURE_DISABLED_BY_DEFAULT}; 79 "OmniboxWarmUpSearchProviderOnFocus", base::FEATURE_DISABLED_BY_DEFAULT};
80 80
81 // Feature used to enable the transmission of HTTPS URLs as part of the 81 // Feature used to enable the transmission of HTTPS URLs as part of the
82 // context to the suggest server (assuming SearchProvider is permitted to 82 // context to the suggest server (assuming SearchProvider is permitted to
83 // transmit URLs for context in the first place). 83 // transmit URLs for context in the first place).
84 const base::Feature kSearchProviderContextAllowHttpsUrls{ 84 const base::Feature kSearchProviderContextAllowHttpsUrls{
85 "OmniboixSearchProviderContextAllowHttpsUrls", 85 "OmniboixSearchProviderContextAllowHttpsUrls",
86 base::FEATURE_DISABLED_BY_DEFAULT}; 86 base::FEATURE_DISABLED_BY_DEFAULT};
87 87
88 // Feature used for the Zero Suggest Redirect to Chrome Field Trial.
89 const base::Feature kZeroSuggestRedirectToChrome{
90 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT};
91
92 // Feature used to swap the title and URL when providing zero suggest 88 // Feature used to swap the title and URL when providing zero suggest
93 // suggestions. 89 // suggestions.
94 const base::Feature kZeroSuggestSwapTitleAndUrl{ 90 const base::Feature kZeroSuggestSwapTitleAndUrl{
95 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; 91 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT};
96 92
97 // Feature used to display the title of the current URL match. 93 // Feature used to display the title of the current URL match.
98 const base::Feature kDisplayTitleForCurrentUrl{ 94 const base::Feature kDisplayTitleForCurrentUrl{
99 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT}; 95 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT};
100 96
101 // Feature used for the max autocomplete matches UI experiment. 97 // Feature used for the max autocomplete matches UI experiment.
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 kBundledExperimentFieldTrialName, 689 kBundledExperimentFieldTrialName,
694 kPhysicalWebAfterTypingBaseRelevanceParam)); 690 kPhysicalWebAfterTypingBaseRelevanceParam));
695 int base_relevance; 691 int base_relevance;
696 if (!param_value.empty() && base::StringToInt(param_value, &base_relevance)) 692 if (!param_value.empty() && base::StringToInt(param_value, &base_relevance))
697 return base_relevance; 693 return base_relevance;
698 // Default relevance score of the first Physical Web URL autocomplete match 694 // Default relevance score of the first Physical Web URL autocomplete match
699 // when the user is typing in the omnibox. 695 // when the user is typing in the omnibox.
700 return 700; 696 return 700;
701 } 697 }
702 698
703 // static
704 bool OmniboxFieldTrial::InZeroSuggestRedirectToChromeFieldTrial() {
705 return base::FeatureList::IsEnabled(omnibox::kZeroSuggestRedirectToChrome);
706 }
707
708 // static
709 std::string OmniboxFieldTrial::ZeroSuggestRedirectToChromeServerAddress() {
710 return base::GetFieldTrialParamValueByFeature(
711 omnibox::kZeroSuggestRedirectToChrome,
712 kZeroSuggestRedirectToChromeServerAddressParam);
713 }
714
715 // static
716 std::string OmniboxFieldTrial::ZeroSuggestRedirectToChromeAdditionalFields() {
717 return base::GetFieldTrialParamValueByFeature(
718 omnibox::kZeroSuggestRedirectToChrome,
719 kZeroSuggestRedirectToChromeAdditionalFieldsParam);
720 }
721
722 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = 699 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] =
723 "OmniboxBundledExperimentV1"; 700 "OmniboxBundledExperimentV1";
724 const char OmniboxFieldTrial::kDisableProvidersRule[] = "DisableProviders"; 701 const char OmniboxFieldTrial::kDisableProvidersRule[] = "DisableProviders";
725 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = 702 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] =
726 "ShortcutsScoringMaxRelevance"; 703 "ShortcutsScoringMaxRelevance";
727 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; 704 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory";
728 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; 705 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType";
729 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = 706 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] =
730 "HQPBookmarkValue"; 707 "HQPBookmarkValue";
731 const char OmniboxFieldTrial::kHQPTypedValueRule[] = "HQPTypedValue"; 708 const char OmniboxFieldTrial::kHQPTypedValueRule[] = "HQPTypedValue";
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 "MaxNumHQPUrlsIndexedAtStartupOnLowEndDevices"; 772 "MaxNumHQPUrlsIndexedAtStartupOnLowEndDevices";
796 const char 773 const char
797 OmniboxFieldTrial::kMaxNumHQPUrlsIndexedAtStartupOnNonLowEndDevicesParam[] = 774 OmniboxFieldTrial::kMaxNumHQPUrlsIndexedAtStartupOnNonLowEndDevicesParam[] =
798 "MaxNumHQPUrlsIndexedAtStartupOnNonLowEndDevices"; 775 "MaxNumHQPUrlsIndexedAtStartupOnNonLowEndDevices";
799 776
800 const char OmniboxFieldTrial::kPhysicalWebZeroSuggestBaseRelevanceParam[] = 777 const char OmniboxFieldTrial::kPhysicalWebZeroSuggestBaseRelevanceParam[] =
801 "PhysicalWebZeroSuggestBaseRelevance"; 778 "PhysicalWebZeroSuggestBaseRelevance";
802 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] = 779 const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] =
803 "PhysicalWebAfterTypingBaseRelevanceParam"; 780 "PhysicalWebAfterTypingBaseRelevanceParam";
804 781
805 const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] =
806 "ZeroSuggestRedirectToChromeServerAddress";
807 const char
808 OmniboxFieldTrial::kZeroSuggestRedirectToChromeAdditionalFieldsParam[] =
809 "ZeroSuggestRedirectToChromeAdditionalFields";
810
811 const char OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam[] = 782 const char OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam[] =
812 "UIMaxAutocompleteMatches"; 783 "UIMaxAutocompleteMatches";
813 const char OmniboxFieldTrial::kUIVerticalMarginParam[] = "UIVerticalMargin"; 784 const char OmniboxFieldTrial::kUIVerticalMarginParam[] = "UIVerticalMargin";
814 785
815 // static 786 // static
816 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100; 787 int OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 100;
817 788
818 // Background and implementation details: 789 // Background and implementation details:
819 // 790 //
820 // Each experiment group in any field trial can come with an optional set of 791 // Each experiment group in any field trial can come with an optional set of
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 if (it != params.end()) 841 if (it != params.end())
871 return it->second; 842 return it->second;
872 // Fall back to the global instant extended context. 843 // Fall back to the global instant extended context.
873 it = params.find(rule + ":" + page_classification_str + ":*"); 844 it = params.find(rule + ":" + page_classification_str + ":*");
874 if (it != params.end()) 845 if (it != params.end())
875 return it->second; 846 return it->second;
876 // Look up rule in the global context. 847 // Look up rule in the global context.
877 it = params.find(rule + ":*:*"); 848 it = params.find(rule + ":*:*");
878 return (it != params.end()) ? it->second : std::string(); 849 return (it != params.end()) ? it->second : std::string();
879 } 850 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698