libassistant-v2: Add the feature to about flags

By adding the feature `LibAssistantV2` to the about flags, we could experiment this feature much easier.

Bug: b:258538951
Test: manual
Change-Id: Id86a8d08e4d74c95a46d1bd3e95403af3d028d95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4019813
Reviewed-by: Xiaohui Chen <[email protected]>
Commit-Queue: Tao Wu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1069923}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index af80068..9e239a5d 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2937,6 +2937,8 @@
 constexpr char kWallpaperGooglePhotosIntegrationInternalName[] =
     "wallpaper-google-photos-integration";
 constexpr char kWallpaperPerDeskName[] = "per-desk-wallpaper";
+constexpr char kLibAssistantV2MigrationInternalName[] =
+    "cros-libassistant-v2-migration";
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -9914,6 +9916,13 @@
      FEATURE_VALUE_TYPE(enterprise_auth::kCloudApAuth)},
 #endif  // BUILDFLAG(IS_WIN)
 
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+    {kLibAssistantV2MigrationInternalName,
+     flag_descriptions::kLibAssistantV2MigrationName,
+     flag_descriptions::kLibAssistantV2MigrationDescription, kOsCrOS,
+     FEATURE_VALUE_TYPE(ash::assistant::features::kEnableLibAssistantV2)},
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
+
     // NOTE: Adding a new flag requires adding a corresponding entry to enum
     // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
     // Histograms" in tools/metrics/histograms/README.md (run the
@@ -10060,6 +10069,14 @@
   if (!strcmp(kWelcomeScreenInternalName, entry.internal_name)) {
     return channel == version_info::Channel::STABLE;
   }
+
+  // Only show LibAssistant V2 migration flag if channel is one of
+  // Dev/Canary/Unknown.
+  if (!strcmp(kLibAssistantV2MigrationInternalName, entry.internal_name)) {
+    return (channel != version_info::Channel::DEV &&
+            channel != version_info::Channel::CANARY &&
+            channel != version_info::Channel::UNKNOWN);
+  }
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
   // enable-unsafe-webgpu is only available on Dev/Canary channels.
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 17efb603..3fb3850 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1175,6 +1175,11 @@
     "expiry_milestone": 110
   },
   {
+    "name": "cros-libassistant-v2-migration",
+    "owners": ["[email protected]", "[email protected]"],
+    "expiry_milestone": 112
+  },
+  {
     "name": "cros-privacy-hub-v0",
     "owners": [ "[email protected]" ],
     "expiry_milestone": 120
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index ca9ba25..68299fc 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -6161,6 +6161,10 @@
 const char kOobeMaterialNextDescription[] =
     "Feature to enable the Material Next design in out of box experience.";
 
+const char kLibAssistantV2MigrationName[] = "LibAssistant V2 migration";
+const char kLibAssistantV2MigrationDescription[] =
+    "Enables loading LibAssistant V2 for Assistant on ChromeOS.";
+
 // Prefer keeping this section sorted to adding new definitions down here.
 
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 1fa0fd1..4d7af3f 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -3543,6 +3543,9 @@
 extern const char kOobeMaterialNextName[];
 extern const char kOobeMaterialNextDescription[];
 
+extern const char kLibAssistantV2MigrationName[];
+extern const char kLibAssistantV2MigrationDescription[];
+
 // Prefer keeping this section sorted to adding new declarations down here.
 
 #endif  // #if BUILDFLAG(IS_CHROMEOS_ASH)