Add windowOptOutEdgeToEdgeEnforcement to v35 themes

Bug: 331681966
Change-Id: I1ef95c2f76591d57e63d51e9650c30d52cc600e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5695906
Reviewed-by: Sinan Sahin <sinansahin@google.com>
Auto-Submit: Theresa Sullivan <twellington@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/main@{#1326201}
diff --git a/components/browser_ui/theme/android/BUILD.gn b/components/browser_ui/theme/android/BUILD.gn
index 283b6d2b..5de1c23 100644
--- a/components/browser_ui/theme/android/BUILD.gn
+++ b/components/browser_ui/theme/android/BUILD.gn
@@ -8,6 +8,7 @@
   sources = [
     "java/res/values-night/colors.xml",
     "java/res/values-night/themes.xml",
+    "java/res/values-v35/themes.xml",
     "java/res/values/attrs.xml",
     "java/res/values/colors.xml",
     "java/res/values/themes.xml",
diff --git a/components/browser_ui/theme/android/java/res/values-v35/themes.xml b/components/browser_ui/theme/android/java/res/values-v35/themes.xml
new file mode 100644
index 0000000..a2d16920
--- /dev/null
+++ b/components/browser_ui/theme/android/java/res/values-v35/themes.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2024 The Chromium Authors. All rights reserved.
+     Use of this source code is governed by a BSD-style license that can be
+     found in the LICENSE file. -->
+
+<resources xmlns:tools="http://schemas.android.com/tools">
+    <style name="Base.V35.Theme.BrowserUI" parent="Base.V31.Theme.BrowserUI">
+        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
+    </style>
+    <style name="Theme.BrowserUI.DialogWhenLarge.V35" parent="Theme.BrowserUI.DialogWhenLarge">
+        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
+    </style>
+    <style name="Theme.BrowserUI.AlertDialog.NoActionBar.V35" parent="Theme.BrowserUI.AlertDialog.NoActionBar">
+        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
+    </style>
+</resources>