Commit 9928adc4 authored by Tim Song's avatar Tim Song Committed by Commit Bot

Revert "Fixed Bubbles not tracking the NativeTheme of their anchoring Widget"

This reverts commit c939527d.

Reason for revert: regressed crbug.com/1065739

Original change's description:
> Fixed Bubbles not tracking the NativeTheme of their anchoring Widget
> 
> Currently child windows do not track the themes of their anchoring
> widget. This can lead to theme mismatches in spawned bubbles (in
> particular icons relying on native theme colors in the profile menu
> for linux themes).
> 
> This change follows on from a previous change that fixes the issue
> for ThemeProviders in Bubbles. Follow up CLs should address the
> issue for the more general case of widgets tracking the themes of
> the Widgets that spawned them (see https://crbug.com/948859).
> 
> Bug: 1057962
> Change-Id: Ie3a71208cb920e8bced6a8bb2f42968bad46f403
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121075
> Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
> Reviewed-by: Peter Kasting <pkasting@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#753398}

TBR=pkasting@chromium.org,tluk@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1057962
Change-Id: I16a9cae400f47ba2f5172637b8aefaea74050b3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2131214Reviewed-by: default avatarTim Song <tengs@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756031}
parent b13a4aa3
......@@ -47,28 +47,15 @@ class BubbleWidget : public Widget {
BubbleWidget() = default;
// Widget:
// TODO(tluk) Fix child windows so that they inherit the theme properties of
// their parent. Currently this only fixes the problem for bubble dialogs
// anchored to another window. (https://crbug.com/948859)
const ui::ThemeProvider* GetThemeProvider() const override {
const Widget* anchor_widget = GetAnchorWidget();
return anchor_widget ? anchor_widget->GetThemeProvider()
: Widget::GetThemeProvider();
}
const ui::NativeTheme* GetNativeTheme() const override {
const Widget* anchor_widget = GetAnchorWidget();
return anchor_widget ? anchor_widget->GetNativeTheme()
: Widget::GetNativeTheme();
}
private:
const Widget* GetAnchorWidget() const {
BubbleDialogDelegateView* const bubble_delegate =
static_cast<BubbleDialogDelegateView*>(widget_delegate());
return bubble_delegate ? bubble_delegate->anchor_widget() : nullptr;
if (!bubble_delegate || !bubble_delegate->anchor_widget())
return Widget::GetThemeProvider();
return bubble_delegate->anchor_widget()->GetThemeProvider();
}
private:
DISALLOW_COPY_AND_ASSIGN(BubbleWidget);
};
......
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