diff --git a/atom/browser/api/atom_api_browser_window.cc b/atom/browser/api/atom_api_browser_window.cc index fd980a57c22..6d2de434a0f 100644 --- a/atom/browser/api/atom_api_browser_window.cc +++ b/atom/browser/api/atom_api_browser_window.cc @@ -20,7 +20,9 @@ #include "atom/common/options_switches.h" #include "base/command_line.h" #include "base/threading/thread_task_runner_handle.h" +#include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/public/browser/render_process_host.h" +#include "content/public/browser/render_view_host.h" #include "content/public/common/content_switches.h" #include "native_mate/constructor.h" #include "native_mate/dictionary.h" @@ -177,6 +179,18 @@ BrowserWindow::~BrowserWindow() { base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, window_.release()); } +void BrowserWindow::RenderViewCreated( + content::RenderViewHost* render_view_host) { + if (!window_->transparent()) + return; + + content::RenderWidgetHostImpl* impl = content::RenderWidgetHostImpl::FromID( + render_view_host->GetProcess()->GetID(), + render_view_host->GetRoutingID()); + if (impl) + impl->SetBackgroundOpaque(false); +} + void BrowserWindow::DidFirstVisuallyNonEmptyPaint() { if (window_->IsVisible()) return; diff --git a/atom/browser/api/atom_api_browser_window.h b/atom/browser/api/atom_api_browser_window.h index e0d0569ae34..deb7d738b21 100644 --- a/atom/browser/api/atom_api_browser_window.h +++ b/atom/browser/api/atom_api_browser_window.h @@ -62,6 +62,7 @@ class BrowserWindow : public mate::TrackableObject, ~BrowserWindow() override; // content::WebContentsObserver: + void RenderViewCreated(content::RenderViewHost* render_view_host) override; void DidFirstVisuallyNonEmptyPaint() override; // NativeWindowObserver: diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 3e488d9ecd1..89f443c7fc1 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -24,7 +24,6 @@ #include "brightray/browser/inspectable_web_contents.h" #include "brightray/browser/inspectable_web_contents_view.h" #include "components/prefs/pref_service.h" -#include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/plugin_service.h" #include "content/public/browser/render_process_host.h" @@ -653,18 +652,6 @@ std::unique_ptr NativeWindow::DraggableRegionsToSkRegion( return sk_region; } -void NativeWindow::RenderViewCreated( - content::RenderViewHost* render_view_host) { - if (!transparent_) - return; - - content::RenderWidgetHostImpl* impl = content::RenderWidgetHostImpl::FromID( - render_view_host->GetProcess()->GetID(), - render_view_host->GetRoutingID()); - if (impl) - impl->SetBackgroundOpaque(false); -} - void NativeWindow::BeforeUnloadDialogCancelled() { WindowList::WindowCloseCancelled(this); diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index 9c1ccb2f425..3f91fefd100 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -318,7 +318,6 @@ class NativeWindow : public base::SupportsUserData, const std::vector& regions); // content::WebContentsObserver: - void RenderViewCreated(content::RenderViewHost* render_view_host) override; void BeforeUnloadDialogCancelled() override; bool OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* rfh) override;