Chromium Code Reviews| Index: chrome/browser/ui/views/frame/contents_web_view.cc |
| diff --git a/chrome/browser/ui/views/frame/contents_web_view.cc b/chrome/browser/ui/views/frame/contents_web_view.cc |
| index 151823ad34a7d75b21e0648aed23847077a88832..aaf54023ada95c7cc65475780ce9fa23f5215712 100644 |
| --- a/chrome/browser/ui/views/frame/contents_web_view.cc |
| +++ b/chrome/browser/ui/views/frame/contents_web_view.cc |
| @@ -6,6 +6,7 @@ |
| #include "chrome/browser/themes/theme_properties.h" |
| #include "chrome/browser/ui/views/status_bubble_views.h" |
| +#include "content/public/browser/render_frame_host.h" |
| #include "content/public/browser/render_widget_host_view.h" |
| #include "content/public/browser/web_contents.h" |
| #include "ui/base/theme_provider.h" |
| @@ -129,3 +130,15 @@ void ContentsWebView::RenderViewReady() { |
| OnThemeChanged(); |
| WebView::RenderViewReady(); |
| } |
| + |
| +void ContentsWebView::RenderFrameHostChanged( |
| + content::RenderFrameHost* old_host, content::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 && new_host) |
|
sky
2016/05/04 20:39:09
If this is the right change, can't we do it entire
chrishtr
2016/05/04 21:10:18
I'm not sure what you mean. What do you mean by "i
sky
2016/05/04 21:48:06
Content knows when the renderframehost is changing
chrishtr
2016/05/04 23:07:16
Done (hope I understood your suggestion).
Should
|
| + new_host->GetView()->SetBackgroundColor( |
| + old_host->GetView()->background_color()); |
| + WebView::RenderFrameHostChanged(old_host, new_host); |
| +} |