[omnibox] Add flags for enabling and setting max URL suggestions

This CL only adds a flag with parameter for enabling capping the
number of URL suggestions, and configuring the limit.

Bug: 963174
Change-Id: I5d4310cf361dc5af1df734b8ff433720eef10fc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635435
Commit-Queue: Kevin Bailey <[email protected]>
Reviewed-by: Justin Donnelly <[email protected]>
Cr-Commit-Position: refs/heads/master@{#664781}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 6213bdf0..bad6c93 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -751,6 +751,29 @@
         {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
          base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
 
+const FeatureEntry::FeatureParam kOmniboxMaxURLMatches2[] = {
+    {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "2"}};
+const FeatureEntry::FeatureParam kOmniboxMaxURLMatches3[] = {
+    {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "3"}};
+const FeatureEntry::FeatureParam kOmniboxMaxURLMatches4[] = {
+    {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "4"}};
+const FeatureEntry::FeatureParam kOmniboxMaxURLMatches5[] = {
+    {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "5"}};
+const FeatureEntry::FeatureParam kOmniboxMaxURLMatches6[] = {
+    {OmniboxFieldTrial::kOmniboxMaxURLMatchesParam, "6"}};
+
+const FeatureEntry::FeatureVariation kOmniboxMaxURLMatchesVariations[] = {
+    {"2 matches", kOmniboxMaxURLMatches2, base::size(kOmniboxMaxURLMatches2),
+     nullptr},
+    {"3 matches", kOmniboxMaxURLMatches3, base::size(kOmniboxMaxURLMatches3),
+     nullptr},
+    {"4 matches", kOmniboxMaxURLMatches4, base::size(kOmniboxMaxURLMatches4),
+     nullptr},
+    {"5 matches", kOmniboxMaxURLMatches5, base::size(kOmniboxMaxURLMatches5),
+     nullptr},
+    {"6 matches", kOmniboxMaxURLMatches6, base::size(kOmniboxMaxURLMatches6),
+     nullptr}};
+
 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || \
     defined(OS_CHROMEOS)
 const FeatureEntry::FeatureParam kTranslateBubbleUIButton[] = {
@@ -2532,6 +2555,12 @@
          kOmniboxUIMaxAutocompleteMatchesVariations,
          "OmniboxUIMaxAutocompleteVariations")},
 
+    {"omnibox-max-url-matches", flag_descriptions::kOmniboxMaxURLMatchesName,
+     flag_descriptions::kOmniboxMaxURLMatchesDescription, kOsAll,
+     FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOmniboxMaxURLMatches,
+                                    kOmniboxMaxURLMatchesVariations,
+                                    "OmniboxMaxURLMatchesVariations")},
+
     {"omnibox-ui-vertical-margin",
      flag_descriptions::kOmniboxUIVerticalMarginName,
      flag_descriptions::kOmniboxUIVerticalMarginDescription, kOsDesktop,