diff --git a/build/e_patches/0049-Change-accent-and-switch-to-match-our-palette.patch b/build/e_patches/0049-Change-accent-and-switch-to-match-our-palette.patch new file mode 100644 index 0000000000000000000000000000000000000000..1a4fbcb4b222f6cc44c6a92cea546a8de9ab0b8e --- /dev/null +++ b/build/e_patches/0049-Change-accent-and-switch-to-match-our-palette.patch @@ -0,0 +1,466 @@ +From d0403be656d7b3a627b72256cc5324de1fbaa53c Mon Sep 17 00:00:00 2001 +From: Nishith Khanna +Date: Tue, 20 Feb 2024 20:35:25 +0530 +Subject: [PATCH] Change accent and switch to match our palette + +--- + .../keyboard_accessory_sheet_tab_option_toggle.xml | 2 +- + .../tasks/tab_management/TabUiThemeProvider.java | 9 +++------ + .../android/java/res/layout/bookmark_save_flow.xml | 2 +- + .../java/res/layout/improved_bookmark_save_flow.xml | 2 +- + .../res/layout/incognito_cookie_controls_card.xml | 2 +- + .../revamped_incognito_cookie_controls_card.xml | 2 +- + .../java/res/layout/readaloud_toggle_switch.xml | 2 +- + .../layout/fast_checkout_autofill_profile_item.xml | 2 +- + .../res/layout/fast_checkout_credit_card_item.xml | 2 +- + .../java/res/layout/fast_checkout_footer_item.xml | 2 +- + .../chrome/browser/omnibox/UrlBarViewBinder.java | 2 +- + .../omnibox/styles/OmniboxResourceProvider.java | 2 +- + components/browser_ui/styles/android/BUILD.gn | 4 ++++ + .../android/java/res/color/e_switch_thumb_color.xml | 5 +++++ + .../android/java/res/color/e_switch_track_color.xml | 6 ++++++ + .../android/java/res/color/text_highlight_color.xml | 2 +- + .../android/java/res/drawable/e_switch_thumb.xml | 9 +++++++++ + .../android/java/res/drawable/e_switch_track.xml | 9 +++++++++ + .../java/res/values/semantic_colors_dynamic.xml | 6 +++--- + .../styles/android/java/res/values/styles.xml | 4 ++++ + .../styles/android/java/res/values/themes.xml | 2 +- + .../theme/android/java/res/values/themes.xml | 12 ++++++------ + .../android/java/res/layout/preference_switch.xml | 2 +- + .../android/res/layout/infobar_control_toggle.xml | 2 +- + ui/android/java/res/values/color_palette.xml | 9 +++++++-- + 25 files changed, 71 insertions(+), 32 deletions(-) + create mode 100644 components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml + create mode 100644 components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml + create mode 100644 components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml + create mode 100644 components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml + +diff --git a/chrome/android/features/keyboard_accessory/internal/java/res/layout/keyboard_accessory_sheet_tab_option_toggle.xml b/chrome/android/features/keyboard_accessory/internal/java/res/layout/keyboard_accessory_sheet_tab_option_toggle.xml +index 9d1713c43e8b1..5cefd325aae52 100644 +--- a/chrome/android/features/keyboard_accessory/internal/java/res/layout/keyboard_accessory_sheet_tab_option_toggle.xml ++++ b/chrome/android/features/keyboard_accessory/internal/java/res/layout/keyboard_accessory_sheet_tab_option_toggle.xml +@@ -39,7 +39,7 @@ found in the LICENSE file. + android:textAppearance="@style/TextAppearance.TextMedium.Secondary" /> + + +- + + +- + + +- + +- + +- +- + +diff --git a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml +index 4e9e8deb14885..ab4d39f056a55 100644 +--- a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml ++++ b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml +@@ -57,6 +57,6 @@ found in the LICENSE file. + android:layout_marginEnd="@dimen/fast_checkout_detail_sheet_selected_icon_margin_end" + android:layout_gravity="center_vertical" + android:contentDescription="@null" +- app:tint="?attr/colorPrimary" ++ app:tint="@color/default_control_color_active_baseline" + app:srcCompat="@drawable/ic_check_circle_filled_green_24dp" /> + +diff --git a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml +index ecc6bc6b9b150..175082479e551 100644 +--- a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml ++++ b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml +@@ -20,4 +20,4 @@ found in the LICENSE file. + android:drawablePadding="@dimen/fast_checkout_detail_sheet_footer_icon_margin_horizontal" + app:drawableWidth="24dp" + app:drawableHeight="24dp" +- app:drawableTint="?attr/colorPrimary" /> ++ app:drawableTint="@color/default_control_color_active_baseline" /> +diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java +index 694dab66f3ba5..febd429f35cf8 100644 +--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java ++++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java +@@ -151,7 +151,7 @@ class UrlBarViewBinder { + final int color = + useIncognitoColors + ? view.getContext().getColor(R.color.default_control_color_active_dark) +- : MaterialColors.getColor(view, R.attr.colorPrimary); ++ : view.getContext().getColor(R.color.default_control_color_active_baseline); + textCursor.mutate().setTint(color); + textSelectHandle.mutate().setTint(color); + textSelectHandleLeft.mutate().setTint(color); +diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java +index 732ebfc70beaa..be6c6bd5b0311 100644 +--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java ++++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java +@@ -359,7 +359,7 @@ public class OmniboxResourceProvider { + if (brandedColorScheme == BrandedColorScheme.INCOGNITO) { + return context.getColor(R.color.locationbar_status_preview_color_incognito); + } +- return MaterialColors.getColor(context, R.attr.colorPrimary, TAG); ++ return context.getColor(R.color.default_control_color_active_baseline); + } + + /** +diff --git a/components/browser_ui/styles/android/BUILD.gn b/components/browser_ui/styles/android/BUILD.gn +index 28c006e6445d3..8f3d91256e19d 100644 +--- a/components/browser_ui/styles/android/BUILD.gn ++++ b/components/browser_ui/styles/android/BUILD.gn +@@ -51,6 +51,8 @@ android_resources("java_resources") { + "java/res/color/text_button_ripple_color_list.xml", + "java/res/color/text_highlight_color.xml", + "java/res/color/toolbar_button_highlight_color.xml", ++ "java/res/color/e_switch_thumb_color.xml", ++ "java/res/color/e_switch_track_color.xml", + "java/res/drawable-hdpi/btn_star_filled.png", + "java/res/drawable-hdpi/ic_chrome.png", + "java/res/drawable-hdpi/ic_delete_white_24dp.png", +@@ -231,6 +233,8 @@ android_resources("java_resources") { + "java/res/drawable/ic_youtube_searched_for_24dp.xml", + "java/res/drawable/smartphone_black_24dp.xml", + "java/res/drawable/toolbar_hairline.xml", ++ "java/res/drawable/e_switch_thumb.xml", ++ "java/res/drawable/e_switch_track.xml", + "java/res/values-night/colors.xml", + "java/res/values-night/dimens.xml", + "java/res/values-night/drawables.xml", +diff --git a/components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml b/components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml +new file mode 100644 +index 0000000000000..32d4f07465128 +--- /dev/null ++++ b/components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml +@@ -0,0 +1,5 @@ ++ ++ ++ ++ ++ +diff --git a/components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml b/components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml +new file mode 100644 +index 0000000000000..89e09db4091c3 +--- /dev/null ++++ b/components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ ++ +diff --git a/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml b/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml +index 141d168fd81fd..48dbfd3c1306b 100644 +--- a/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml ++++ b/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml +@@ -6,5 +6,5 @@ found in the LICENSE file. + --> + + +- ++ + +diff --git a/components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml b/components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml +new file mode 100644 +index 0000000000000..48dfa90e45cf4 +--- /dev/null ++++ b/components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml +@@ -0,0 +1,9 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml b/components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml +new file mode 100644 +index 0000000000000..f5b1eed6f2e6f +--- /dev/null ++++ b/components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml +@@ -0,0 +1,9 @@ ++ ++ ++ ++ ++ +diff --git a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml +index 0751e42592c15..f8fe65c139098 100644 +--- a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml ++++ b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml +@@ -8,17 +8,17 @@ found in the LICENSE file. + ?attr/colorSurface + ?attr/colorSurface + +- ?attr/colorPrimary ++ @color/default_control_color_active_baseline + ?attr/colorOnSurfaceVariant + + ?attr/colorOnSurface +- ?attr/colorPrimary ++ @color/default_control_color_active_baseline + ?attr/colorOnSurfaceInverse + ?attr/colorOnPrimary + ?attr/colorOnSurfaceVariant + + ?attr/colorOnSurface +- ?attr/colorPrimary ++ @color/default_control_color_active_baseline + ?attr/colorOnPrimary + ?attr/colorOnPrimaryContainer + ?attr/colorOnSecondaryContainer +diff --git a/components/browser_ui/styles/android/java/res/values/styles.xml b/components/browser_ui/styles/android/java/res/values/styles.xml +index e0861e7c69ef7..f58e9d9aa5e97 100644 +--- a/components/browser_ui/styles/android/java/res/values/styles.xml ++++ b/components/browser_ui/styles/android/java/res/values/styles.xml +@@ -20,9 +20,13 @@ found in the LICENSE file. + @style/TextAppearance.TextMedium.Primary + + + + +