Index: content/browser/frame_host/render_frame_host_manager.cc |
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc |
index db0cf760cfc4157ccbf39a35869061d2f6cf3c87..de21bd41582cc8213d14c4aab131afa2e2cd0a78 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -2207,6 +2207,15 @@ void RenderFrameHostManager::CommitPending() { |
// The process will no longer try to exit, so we can decrement the count. |
render_frame_host_->GetProcess()->RemovePendingView(); |
+ // Save off the old background color before possibly deleting the |
+ // old RenderWidgetHostView. |
+ SkColor old_background_color = SK_ColorWHITE; |
+ bool has_old_background_color = false; |
+ if (old_render_frame_host->GetView()) { |
+ has_old_background_color = true; |
+ old_background_color = old_render_frame_host->GetView()->background_color(); |
+ } |
+ |
// The RenderViewHost keeps track of the main RenderFrameHost routing id. |
// If this is committing a main frame navigation, update it and set the |
// routing id in the RenderViewHost associated with the old RenderFrameHost |
@@ -2283,6 +2292,9 @@ void RenderFrameHostManager::CommitPending() { |
delegate_->NotifySwappedFromRenderManager( |
old_render_frame_host.get(), render_frame_host_.get(), is_main_frame); |
+ if (has_old_background_color && render_frame_host_->GetView()) |
+ render_frame_host_->GetView()->SetBackgroundColor(old_background_color); |
+ |
// Swap out the old frame now that the new one is visible. |
// This will swap it out and schedule it for deletion when the swap out ack |
// arrives (or immediately if the process isn't live). |