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

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

Issue 2466413009: Propagate view background color when changing visible web contents. (Closed)
Patch Set: none Created 4 years, 1 month 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 a24ea16d2dff31c2e46d04080e2556a8751f4228..78af2c80b3e30a3b21f62cc28dd6768eaa58186e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3954,6 +3954,12 @@ void WebContentsImpl::LoadingStateChanged(bool to_different_document,
void WebContentsImpl::NotifyViewSwapped(RenderViewHost* old_host,
RenderViewHost* new_host) {
+ if (old_host && new_host) {
+ RenderWidgetHostView* old_view = old_host->GetWidget()->GetView();
+ RenderWidgetHostView* new_view = new_host->GetWidget()->GetView();
nasko 2016/11/09 20:18:58 I would put this code in WebContentsImpl::NotifyFr
chrishtr 2016/11/09 21:45:21 Done.
+ if (old_view && new_view)
+ new_view->SetBackgroundColor(old_view->background_color());
clamy 2016/11/09 15:56:35 Mmh I think this happens after we've swapped the v
nasko 2016/11/09 20:18:58 It happens in the same event loop as part of commi
chrishtr 2016/11/09 21:45:21 Since it's the same event loop, there is no flash.
+ }
// After sending out a swap notification, we need to send a disconnect
// notification so that clients that pick up a pointer to |this| can NULL the
// pointer. See Bug 1230284.

Powered by Google App Engine
This is Rietveld 408576698