[AGC] Implement Ignore Ui Gains flag.

Introduce IgnoreUiGains flag to ignore ui gains when AGC running.
UI gain will cause bad quality on AGC streams. Ignoring Ui gains
should benefit UX experience. Hiding this behavior under a flag
to run an experiemnt to show this assumption.

IgnoreUiGains will only take effects on AGC streams.

Design doc:
https://docs.google.com/document/d/1nISIRtle-elQMuBQHwO002xgwqtR3mdk1TJdmZZHbAM/edit?resourcekey=0-_aYvkoae_W9US7k7Y7GzTw#

BUG=b:242548161
Test=//media:audio_unittests
Test=blink_unittests
Test=built, deployed, and verified on dut

Change-Id: I845bc87923f3e2c003821d4daf9d5b6abab359bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4410505
Reviewed-by: Olga Sharonova <[email protected]>
Commit-Queue: Eddy Hsu <[email protected]>
Reviewed-by: Dale Curtis <[email protected]>
Reviewed-by: Per Ã…hgren <[email protected]>
Reviewed-by: Sam Zackrisson <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1151002}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 4a67b3b..4560cd41 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7058,6 +7058,12 @@
      FEATURE_VALUE_TYPE(media::kCrOSEnforceSystemAecNs)},
 #endif
 
+#if BUILDFLAG(IS_CHROMEOS)
+    {"ignore-ui-gains", flag_descriptions::kIgnoreUiGainsName,
+     flag_descriptions::kIgnoreUiGainsDescription, kOsCrOS | kOsLacros,
+     FEATURE_VALUE_TYPE(media::kIgnoreUiGains)},
+#endif
+
     {"enable-css-selector-fragment-anchor",
      flag_descriptions::kEnableCssSelectorFragmentAnchorName,
      flag_descriptions::kEnableCssSelectorFragmentAnchorDescription, kOsAll,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index ddc855d..abc29002 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -4471,6 +4471,11 @@
     "expiry_milestone": 116
   },
   {
+    "name": "ignore-ui-gains",
+    "owners": ["eddyhsu"],
+    "expiry_milestone": 130
+  },
+  {
     "name": "improved-keyboard-shortcuts",
     "owners": [ "[email protected]", "[email protected]",
                 "[email protected]"],
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index d74b4fde..82476b65 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -6722,6 +6722,10 @@
 const char kCrOSEnforceSystemAecNsAgcDescription[] =
     "Enforces using the system variants in CrAS of the AEC, NS and AGC.";
 
+const char kIgnoreUiGainsName[] = "Ignore UI Gains in system mic gain setting";
+const char kIgnoreUiGainsDescription[] =
+    "Ignore UI Gains in system mic gain setting";
+
 const char kCrosPrivacyHubName[] = "Enable ChromeOS Privacy Hub";
 const char kCrosPrivacyHubDescription[] = "Enables ChromeOS Privacy Hub.";
 
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 5644611..cfacfd8 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -3914,6 +3914,9 @@
 
 extern const char kTouchTextEditingRedesignName[];
 extern const char kTouchTextEditingRedesignDescription[];
+
+extern const char kIgnoreUiGainsName[];
+extern const char kIgnoreUiGainsDescription[];
 #endif  // BUILDFLAG(IS_CHROMEOS)
 
 #if defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS)