From 9828875ebc5c172b7f9d85a606b7f016f7572a4d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 3 Apr 2016 10:37:48 +0900 Subject: [PATCH] Set the background color of RenderViewHost to transparent --- atom/browser/api/atom_api_web_contents.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 8c0f7d571f35..5156600bb73a 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -728,6 +728,13 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) { params.should_clear_history_list = true; params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; web_contents()->GetController().LoadURLWithParams(params); + + // Set the background color of RenderViewHost to transparent so it doesn't + // override the background color set by the user. + // We have to call it right after LoadURL because the RenderViewHost is only + // created after loading a page. + web_contents()->GetRenderViewHost()->GetWidget()->GetView() + ->SetBackgroundColor(SK_ColorTRANSPARENT); } void WebContents::DownloadURL(const GURL& url) {