From 4ecdb53521344e0ba876eb7096f57ea3323b83b9 Mon Sep 17 00:00:00 2001 From: Xinghui Lu Date: Mon, 22 Aug 2022 18:04:27 +0000 Subject: [PATCH] [M106][DownloadBubble] Adjust toolbar active color based on theme. before: http://screen/QrAPdAVytvJu6Ec after: http://screen/B3ffSyAh7JMgkHW (cherry picked from commit 37b4e28818c4415ddfd3d7ca82a9efdbf7e6f874) Bug: 1354650 Change-Id: I04ba7edfdfdd2f470cd241183dbcd35e42165adb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3842692 Reviewed-by: Rohit Bhatia Commit-Queue: Xinghui Lu Reviewed-by: Peter Kasting Cr-Original-Commit-Position: refs/heads/main@{#1037212} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3846330 Commit-Queue: Peter Kasting Cr-Commit-Position: refs/branch-heads/5249@{#18} Cr-Branched-From: 4f7bea5de862aaa52e6bde5920755a9ef9db120b-refs/heads/main@{#1036826} --- chrome/browser/ui/color/chrome_color_mixer.cc | 4 +++- .../ui/views/download/bubble/download_toolbar_button_view.cc | 5 +++++ .../ui/views/download/bubble/download_toolbar_button_view.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/chrome/browser/ui/color/chrome_color_mixer.cc b/chrome/browser/ui/color/chrome_color_mixer.cc index 1c64aa44c21fc..31ccadda85a39 100644 --- a/chrome/browser/ui/color/chrome_color_mixer.cc +++ b/chrome/browser/ui/color/chrome_color_mixer.cc @@ -241,7 +241,9 @@ void AddChromeColorMixer(ui::ColorProvider* provider, kColorToolbarButtonIcon, kColorDownloadShelfBackground, 0x3A); mixer[kColorDownloadShelfForeground] = {kColorToolbarText}; mixer[kColorDownloadStartedAnimationForeground] = {ui::kColorAccent}; - mixer[kColorDownloadToolbarButtonActive] = {ui::kColorThrobber}; + mixer[kColorDownloadToolbarButtonActive] = + ui::PickGoogleColor(ui::kColorThrobber, kColorToolbar, + color_utils::kMinimumVisibleContrastRatio); mixer[kColorDownloadToolbarButtonInactive] = {kColorToolbarButtonIcon}; mixer[kColorDownloadToolbarButtonRingBackground] = { SkColorSetA(kColorDownloadToolbarButtonInactive, 0x33)}; diff --git a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc index bc057699dad95..44e1bd1f604de 100644 --- a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc @@ -287,6 +287,11 @@ void DownloadToolbarButtonView::ButtonPressed() { controller_->OnButtonPressed(); } +void DownloadToolbarButtonView::OnThemeChanged() { + ToolbarButton::OnThemeChanged(); + UpdateIcon(); +} + std::unique_ptr DownloadToolbarButtonView::CreateRowListView( std::vector model_list) { // Do not create empty partial view. diff --git a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h index 69bdbb40a4e15..86591e5b52301 100644 --- a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h +++ b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h @@ -57,6 +57,7 @@ class DownloadToolbarButtonView : public ToolbarButton, // ToolbarButton: void UpdateIcon() override; + void OnThemeChanged() override; // DownloadBubbleNavigationHandler: void OpenPrimaryDialog() override;