Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / omnibox / omnibox_field_trial.cc
index 445d793..26a32c0 100644 (file)
@@ -270,17 +270,25 @@ bool OmniboxFieldTrial::HasDynamicFieldTrialGroupPrefix(
 }
 
 bool OmniboxFieldTrial::InZeroSuggestFieldTrial() {
-  return HasDynamicFieldTrialGroupPrefix(kEnableZeroSuggestGroupPrefix);
+  return HasDynamicFieldTrialGroupPrefix(kEnableZeroSuggestGroupPrefix) ||
+      chrome_variations::GetVariationParamValue(
+          kBundledExperimentFieldTrialName, kZeroSuggestRule) == "true";
 }
 
 bool OmniboxFieldTrial::InZeroSuggestMostVisitedFieldTrial() {
   return HasDynamicFieldTrialGroupPrefix(
-      kEnableZeroSuggestMostVisitedGroupPrefix);
+      kEnableZeroSuggestMostVisitedGroupPrefix) ||
+      chrome_variations::GetVariationParamValue(
+          kBundledExperimentFieldTrialName,
+          kZeroSuggestVariantRule) == "MostVisited";
 }
 
 bool OmniboxFieldTrial::InZeroSuggestAfterTypingFieldTrial() {
   return HasDynamicFieldTrialGroupPrefix(
-      kEnableZeroSuggestAfterTypingGroupPrefix);
+      kEnableZeroSuggestAfterTypingGroupPrefix) ||
+      chrome_variations::GetVariationParamValue(
+          kBundledExperimentFieldTrialName,
+          kZeroSuggestVariantRule) == "AfterTyping";
 }
 
 bool OmniboxFieldTrial::ShortcutsScoringMaxRelevance(
@@ -368,8 +376,8 @@ OmniboxFieldTrial::GetUndemotableTopTypes(
 bool OmniboxFieldTrial::ReorderForLegalDefaultMatch(
     AutocompleteInput::PageClassification current_page_classification) {
   return OmniboxFieldTrial::GetValueForRuleInContext(
-      kReorderForLegalDefaultMatchRule, current_page_classification) ==
-      kReorderForLegalDefaultMatchRuleEnabled;
+      kReorderForLegalDefaultMatchRule, current_page_classification) !=
+      kReorderForLegalDefaultMatchRuleDisabled;
 }
 
 void OmniboxFieldTrial::GetExperimentalHUPScoringParams(
@@ -446,8 +454,10 @@ const char OmniboxFieldTrial::kHQPDiscountFrecencyWhenFewVisitsRule[] =
 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD";
 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] =
     "HQPAllowMatchInScheme";
-const char OmniboxFieldTrial::kReorderForLegalDefaultMatchRuleEnabled[] =
-    "ReorderForLegalDefaultMatch";
+const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest";
+const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant";
+const char OmniboxFieldTrial::kReorderForLegalDefaultMatchRuleDisabled[] =
+    "DontReorderForLegalDefaultMatch";
 
 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] =
     "HUPExperimentalScoringEnabled";