Commit 8728d047 authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Linux: Fix content settings in PWA titlebar glitch when toggling GTK theme

This CL updates a DCHECK to allow for the BrowserNonClientFrameView
getting recreated when the browser window frame is updated via
NonClientView::UpdateFrame().

This also fixes a UI bug where we don't initialise the content setting
icons properly for PWA windows resulting in uninitialised state after
toggling GTK themes.

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=365396&signed_aid=Z-gwLwzrT9I5krg3sUoY7Q==&inline=1
After (ignore Linux screen glitching): https://bugs.chromium.org/p/chromium/issues/attachment?aid=365397&signed_aid=e_kvzb_AGaLLi5zzKY_o7w==&inline=1


Bug: 878639
Change-Id: I57bd1a6f7f94687a0f95557914f34eda737129ee
Reviewed-on: https://chromium-review.googlesource.com/c/1308960Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604452}
parent 894d11b4
......@@ -1083,8 +1083,6 @@ void BrowserView::FullscreenStateChanged() {
}
void BrowserView::SetToolbarButtonProvider(ToolbarButtonProvider* provider) {
// There should only be one toolbar button provider.
DCHECK(!toolbar_button_provider_);
toolbar_button_provider_ = provider;
}
......
......@@ -213,6 +213,7 @@ HostedAppButtonContainer::HostedAppButtonContainer(
views::SetHitTestComponent(content_settings_container_,
static_cast<int>(HTCLIENT));
AddChildView(content_settings_container_);
UpdateContentSettingViewsVisibility();
views::SetHitTestComponent(page_action_icon_container_view_,
static_cast<int>(HTCLIENT));
......@@ -225,6 +226,12 @@ HostedAppButtonContainer::HostedAppButtonContainer(
UpdateChildrenColor();
DCHECK(!browser_view_->toolbar_button_provider() ||
browser_view_->toolbar_button_provider()
->GetAsAccessiblePaneView()
->GetClassName() == GetClassName())
<< "This should be the first ToolbarButtorProvider or a replacement for "
"an existing instance of this class during a window frame refresh.";
browser_view_->SetToolbarButtonProvider(this);
browser_view_->immersive_mode_controller()->AddObserver(this);
scoped_widget_observer_.Add(widget);
......
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