Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1006)

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 2753813003: Fix theme change paint issue on linux. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 46e8977a8fff9c8369ea8aa87166f2d5ea1f1121..e40229f310b832ffe6927d48d3d033f2f9283e34 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1656,6 +1656,22 @@ base::string16 BrowserView::GetAccessibleTabLabel(bool include_app_name,
return base::string16();
}
+void BrowserView::NativeThemeUpdated(const ui::NativeTheme* theme) {
+ // We don't handle theme updates in OnThemeChanged() as that function is
+ // called while views are being iterated over. Please see
+ // View::PropagateNativeThemeChanged() for details. The theme update
+ // handling in UserChangedTheme() can cause views to be nuked or created
+ // which is a bad thing during iteration.
+
+ // Do not handle native theme changes before the browser view is initialized.
+ if (!initialized_)
+ return;
+ // Don't infinitely recurse.
+ if (!handling_theme_changed_)
+ UserChangedTheme();
+ chrome::MaybeShowInvertBubbleView(this);
+}
+
views::View* BrowserView::GetInitiallyFocusedView() {
return nullptr;
}
@@ -1990,17 +2006,6 @@ void BrowserView::OnThemeChanged() {
views::View::OnThemeChanged();
}
-void BrowserView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
- // Do not handle native theme changes before the browser view is initialized.
- if (!initialized_)
- return;
- ClientView::OnNativeThemeChanged(theme);
- // Don't infinitely recurse.
- if (!handling_theme_changed_)
- UserChangedTheme();
- chrome::MaybeShowInvertBubbleView(this);
-}
-
///////////////////////////////////////////////////////////////////////////////
// BrowserView, ui::AcceleratorTarget overrides:
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698