Commit 58e7a87f authored by Dana Fried's avatar Dana Fried Committed by Commit Bot

Regenerate hover card if Win7 theme changes to/from a non-Aero theme.

See attached bug for rationale.

This approach is simplest, but will reset counters associated with
metrics. However, switch from aero to non-aero in Win7 is extremely
infrequent and shouldn't significantly impact actual numbers.

Bug: 1140256
Change-Id: I479d996e22be1e4f77e55d00080aa3d7a9ca4ddf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2503838Reviewed-by: default avatarCaroline Rising <corising@chromium.org>
Commit-Queue: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821462}
parent 543bb910
...@@ -412,7 +412,8 @@ class TabHoverCardBubbleView::ThumbnailObserver ...@@ -412,7 +412,8 @@ class TabHoverCardBubbleView::ThumbnailObserver
}; };
TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab) TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab)
: BubbleDialogDelegateView(tab, views::BubbleBorder::TOP_LEFT) { : BubbleDialogDelegateView(tab, views::BubbleBorder::TOP_LEFT),
using_rounded_corners_(CustomShadowsSupported()) {
SetButtons(ui::DIALOG_BUTTON_NONE); SetButtons(ui::DIALOG_BUTTON_NONE);
// We'll do all of our own layout inside the bubble, so no need to inset this // We'll do all of our own layout inside the bubble, so no need to inset this
...@@ -529,7 +530,7 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab) ...@@ -529,7 +530,7 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab)
views::BubbleFrameView::PreferredArrowAdjustment::kOffset); views::BubbleFrameView::PreferredArrowAdjustment::kOffset);
GetBubbleFrameView()->set_hit_test_transparent(true); GetBubbleFrameView()->set_hit_test_transparent(true);
if (CustomShadowsSupported()) { if (using_rounded_corners_) {
GetBubbleFrameView()->SetCornerRadius( GetBubbleFrameView()->SetCornerRadius(
ChromeLayoutProvider::Get()->GetCornerRadiusMetric( ChromeLayoutProvider::Get()->GetCornerRadiusMetric(
views::EMPHASIS_HIGH)); views::EMPHASIS_HIGH));
...@@ -864,6 +865,13 @@ gfx::Size TabHoverCardBubbleView::CalculatePreferredSize() const { ...@@ -864,6 +865,13 @@ gfx::Size TabHoverCardBubbleView::CalculatePreferredSize() const {
void TabHoverCardBubbleView::OnThemeChanged() { void TabHoverCardBubbleView::OnThemeChanged() {
BubbleDialogDelegateView::OnThemeChanged(); BubbleDialogDelegateView::OnThemeChanged();
// Bubble closes if the theme changes to the point where the border has to be
// regenerated. See crbug.com/1140256
if (using_rounded_corners_ != CustomShadowsSupported()) {
GetWidget()->Close();
return;
}
// Update fade labels' background color to match that of the the original // Update fade labels' background color to match that of the the original
// label since these child views are ignored by layout. // label since these child views are ignored by layout.
title_fade_label_->SetBackgroundColor(title_label_->GetBackgroundColor()); title_fade_label_->SetBackgroundColor(title_label_->GetBackgroundColor());
......
...@@ -122,6 +122,8 @@ class TabHoverCardBubbleView : public views::BubbleDialogDelegateView { ...@@ -122,6 +122,8 @@ class TabHoverCardBubbleView : public views::BubbleDialogDelegateView {
size_t hover_cards_seen_count_ = 0; size_t hover_cards_seen_count_ = 0;
bool waiting_for_decompress_ = false; bool waiting_for_decompress_ = false;
const bool using_rounded_corners_;
base::OneShotTimer delayed_show_timer_; base::OneShotTimer delayed_show_timer_;
}; };
......
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