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

Unified Diff: components/omnibox/browser/omnibox_field_trial.cc

Issue 1411543011: Omnibox: Make Keyword Provide More Generous with Matching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: finish converting AddToMap() calls Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/omnibox/browser/omnibox_field_trial.cc
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc
index b45f0b2651719ffe9e65d19792477376c11a5229..b07ce44642705f45ef0b897ce6023a6e2102a04c 100644
--- a/components/omnibox/browser/omnibox_field_trial.cc
+++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -440,6 +440,35 @@ bool OmniboxFieldTrial::PreventUWYTDefaultForNonURLInputs() {
kPreventUWYTDefaultForNonURLInputsRule) == "true";
}
+bool OmniboxFieldTrial::KeywordRequiresRegistry() {
+ const std::string& value = variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kKeywordRequiresRegistryRule);
+ return value.empty() || (value == "true");
+}
+
+bool OmniboxFieldTrial::KeywordRequiresPrefixMatch() {
+ const std::string& value = variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kKeywordRequiresPrefixMatchRule);
+ return value.empty() || (value == "true");
+}
+
+int OmniboxFieldTrial::KeywordScoreForSufficientlyCompleteMatch() {
+ std::string value_str = variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kKeywordScoreForSufficientlyCompleteMatchRule);
+ if (value_str.empty())
+ return -1;
+ // This is a best-effort conversion; we trust the hand-crafted parameters
+ // downloaded from the server to be perfect. There's no need for handle
+ // errors smartly.
+ int value;
+ base::StringToInt(value_str, &value);
+ return value;
+}
+
+
const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] =
"OmniboxBundledExperimentV1";
const char OmniboxFieldTrial::kDisableProvidersRule[] = "DisableProviders";
@@ -469,6 +498,12 @@ const char OmniboxFieldTrial::kHQPAlsoDoHUPLikeScoringRule[] =
"HQPAlsoDoHUPLikeScoring";
const char OmniboxFieldTrial::kPreventUWYTDefaultForNonURLInputsRule[] =
"PreventUWYTDefaultForNonURLInputs";
+const char OmniboxFieldTrial::kKeywordRequiresRegistryRule[] =
+ "KeywordRequiresRegistry";
+const char OmniboxFieldTrial::kKeywordRequiresPrefixMatchRule[] =
+ "KeywordRequiresPrefixMatch";
+const char OmniboxFieldTrial::kKeywordScoreForSufficientlyCompleteMatchRule[] =
+ "KeywordScoreForSufficientlyCompleteMatch";
const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] =
"HUPExperimentalScoringEnabled";

Powered by Google App Engine
This is Rietveld 408576698