Add a new OptimizationType for Chrome Skills to show/recommend on the current page.

Bug: 470993302

Change-Id: I51884a837ec984489c5e88d8cbf023c6c01dfbce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7415322
Reviewed-by: Mike Wittman <wittman@chromium.org>
Commit-Queue: Janelle Lee <janellelee@google.com>
Reviewed-by: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1567144}
diff --git a/components/optimization_guide/core/hints/hints_processing_util.cc b/components/optimization_guide/core/hints/hints_processing_util.cc
index 7713656..c82bef7 100644
--- a/components/optimization_guide/core/hints/hints_processing_util.cc
+++ b/components/optimization_guide/core/hints/hints_processing_util.cc
@@ -225,6 +225,8 @@
       return "ReaderModeEligible";
     case proto::OptimizationType::AUTOFILL_ACTOR_IFRAME_ORIGIN_ALLOWLIST:
       return "AutofillActorIframeOriginAllowlist";
+    case proto::OptimizationType::SKILLS:
+      return "Skills";
   }
 
   // The returned string is used to record histograms for the optimization type.
diff --git a/components/optimization_guide/proto/hints.proto b/components/optimization_guide/proto/hints.proto
index 2da04f9..9145d99c 100644
--- a/components/optimization_guide/proto/hints.proto
+++ b/components/optimization_guide/proto/hints.proto
@@ -141,6 +141,7 @@
 // OptimizationType enum at http://shortn/_t8G1sv8yAS (Google-internal link).
 // Additionally, these values must be synchronized with the OptimizationType
 // enum in enums.xml and optimization/histograms.xml for metric recording.
+// Next ID: 120
 enum OptimizationType {
   // Values for obsolete optimizations.
   reserved 11, 12, 16, 29, 32, 66, 68, 72, 73, 89, 94, 95, 96, 101;
@@ -386,6 +387,8 @@
   // Provides information about whether a page is eligible for walletable
   // event pass detection.
   WALLETABLE_PASS_DETECTION_EVENT_PASS_ALLOWLIST = 118;
+  // Provides the set of Skills to display on the current page.
+  SKILLS = 119;
 }
 
 // Presents semantics for how page load URLs should be matched.
diff --git a/tools/metrics/histograms/metadata/optimization/enums.xml b/tools/metrics/histograms/metadata/optimization/enums.xml
index 05cfb0b..780c331 100644
--- a/tools/metrics/histograms/metadata/optimization/enums.xml
+++ b/tools/metrics/histograms/metadata/optimization/enums.xml
@@ -797,6 +797,7 @@
   <int value="116" label="AUTOFILL_ACTOR_IFRAME_ORIGIN_ALLOWLIST"/>
   <int value="117" label="WALLETABLE_PASS_DETECTION_TRANSIT_TICKET_ALLOWLIST"/>
   <int value="118" label="WALLETABLE_PASS_DETECTION_EVENT_PASS_ALLOWLIST"/>
+  <int value="119" label="SKILLS"/>
 </enum>
 
 <enum name="PageContentAnnotationsStorageStatus">
diff --git a/tools/metrics/histograms/metadata/optimization/histograms.xml b/tools/metrics/histograms/metadata/optimization/histograms.xml
index 40fcc47b..a521fcb0 100644
--- a/tools/metrics/histograms/metadata/optimization/histograms.xml
+++ b/tools/metrics/histograms/metadata/optimization/histograms.xml
@@ -513,6 +513,8 @@
   <variant name="ShoppingPageTypes"
       summary="This optimization provides information about shopping page
                types of this page."/>
+  <variant name="Skills"
+      summary="Provides the set of Skills to display on the current page."/>
   <variant name="TextClassifierEntityDetection"
       summary="Provides information about whether about whether a page is
                eligible for text classifier entity detection - iOS only."/>