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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1943183002: Transfer theme & page background colors between changes of RWHV. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@noflash
Patch Set: Created 4 years, 7 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
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index bb4128c8f0fda709aef73e59c5b2819c0d1bd7d6..a45a036393aeb5aa28aae63a3bdff73bd23d8788 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3910,6 +3910,15 @@ void WebContentsImpl::NotifyViewSwapped(RenderViewHost* old_host,
void WebContentsImpl::NotifyFrameSwapped(RenderFrameHost* old_host,
RenderFrameHost* new_host) {
+ // Pass the background color of the old host to the new one. This passes
+ // on the page background color of the old host (or the theme color if the
+ // page background color is not set). This avoids flashes of white when
+ // starting up new_host.
+ if (old_host && old_host->GetView() && new_host && new_host->GetView()) {
+ new_host->GetView()->SetBackgroundColor(
+ old_host->GetView()->background_color());
no sievers 2016/05/17 18:05:43 You said this doesn't work reliably. Does it work
+ }
+
FOR_EACH_OBSERVER(WebContentsObserver,
observers_,
RenderFrameHostChanged(old_host, new_host));
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_base.cc ('k') | content/public/browser/render_widget_host_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698