Commit 3777a417 authored by Caroline Rising's avatar Caroline Rising Committed by Commit Bot

Fix bug where the wrong color is shown for tab hover cards after switching...

Fix bug where the wrong color is shown for tab hover cards after switching between system light/dark modes.

The fade label child views are set to be ignored by tab hover card layout. This means the background color is not updated for these labels after creation. This change update the color before an animation would take place.

Bug: 1030328
Change-Id: I8204978fc8983f4ff4b3cc02922a0401cf039244
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951090
Commit-Queue: Caroline Rising <corising@google.com>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721727}
parent 8cb47e19
...@@ -798,6 +798,15 @@ gfx::Size TabHoverCardBubbleView::CalculatePreferredSize() const { ...@@ -798,6 +798,15 @@ gfx::Size TabHoverCardBubbleView::CalculatePreferredSize() const {
return preferred_size; return preferred_size;
} }
void TabHoverCardBubbleView::OnThemeChanged() {
BubbleDialogDelegateView::OnThemeChanged();
// Update fade labels' background color to match that of the the original
// label since these child views are ignored by layout.
title_fade_label_->SetBackgroundColor(title_label_->GetBackgroundColor());
domain_fade_label_->SetBackgroundColor(domain_label_->GetBackgroundColor());
}
void TabHoverCardBubbleView::RecordTimeSinceLastSeenMetric( void TabHoverCardBubbleView::RecordTimeSinceLastSeenMetric(
base::TimeDelta elapsed_time) { base::TimeDelta elapsed_time) {
constexpr base::TimeDelta kMaxHoverCardReshowTimeDelta = constexpr base::TimeDelta kMaxHoverCardReshowTimeDelta =
......
...@@ -89,6 +89,7 @@ class TabHoverCardBubbleView : public views::BubbleDialogDelegateView { ...@@ -89,6 +89,7 @@ class TabHoverCardBubbleView : public views::BubbleDialogDelegateView {
// views::BubbleDialogDelegateView: // views::BubbleDialogDelegateView:
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
void OnThemeChanged() override;
void RecordTimeSinceLastSeenMetric(base::TimeDelta elapsed_time); void RecordTimeSinceLastSeenMetric(base::TimeDelta elapsed_time);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment