[Passwords] Add UI Flag for Leak Detection

This change adds a UI flag for the password leak detection feature.

Bug: 986298
Change-Id: I0dde3c0afa4464bd97bd11c57b8fa7b5de7a8600
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761605
Commit-Queue: Jan Wilken Dörrie <[email protected]>
Commit-Queue: Vasilii Sukhanov <[email protected]>
Auto-Submit: Jan Wilken Dörrie <[email protected]>
Reviewed-by: Vasilii Sukhanov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#688512}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index e97199d..067e020 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4346,6 +4346,10 @@
      FEATURE_VALUE_TYPE(features::kProfileMenuRevamp)},
 #endif  // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
 
+    {"password-leak-detection", flag_descriptions::kPasswordLeakDetectionName,
+     flag_descriptions::kPasswordLeakDetectionDescription, kOsAll,
+     FEATURE_VALUE_TYPE(password_manager::features::kLeakDetection)},
+
     // 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
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 08f68e8d..535316a 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2721,6 +2721,11 @@
     "expiry_milestone": 80
   },
   {
+    "name": "password-leak-detection",
+    "owners": [ "jdoerrie", "vasilii" ],
+    "expiry_milestone": 80
+  },
+  {
     "name": "password-manager-onboarding-android",
     "owners": ["achulkov", "ioanap"],
     "expiry_milestone": 80
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 333b299..81a00b2f 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1528,6 +1528,10 @@
 const char kPasswordImportDescription[] =
     "Import functionality in password settings.";
 
+const char kPasswordLeakDetectionName[] = "Password Leak Detection";
+const char kPasswordLeakDetectionDescription[] =
+    "Enables the detection of leaked passwords.";
+
 const char kForceWebContentsDarkModeName[] = "Force Dark Mode for Web Contents";
 const char kForceWebContentsDarkModeDescription[] =
     "Automatically render all web contents using a dark theme.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index a9bc084..9d81576a 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -918,6 +918,9 @@
 extern const char kPasswordImportName[];
 extern const char kPasswordImportDescription[];
 
+extern const char kPasswordLeakDetectionName[];
+extern const char kPasswordLeakDetectionDescription[];
+
 extern const char kForceWebContentsDarkModeName[];
 extern const char kForceWebContentsDarkModeDescription[];