#include "brightray/browser/inspectable_web_contents_view.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/ui/browser_dialogs.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_entry.h"
using content::RenderWidgetHostView;
using content::RenderWidgetHost;
+namespace content {
+CONTENT_EXPORT extern bool g_use_transparent_window;
+}
+
namespace atom {
namespace {
const mate::Dictionary& options)
: content::WebContentsObserver(web_contents),
has_frame_(true),
+ transparent_(false),
enable_larger_than_screen_(false),
is_closed_(false),
node_integration_(true),
printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
options.Get(switches::kFrame, &has_frame_);
+ options.Get(switches::kTransparent, &transparent_);
options.Get(switches::kEnableLargerThanScreen, &enable_larger_than_screen_);
options.Get(switches::kNodeIntegration, &node_integration_);
+ // Tell the content module to initialize renderer widget with transparent
+ // mode.
+ content::g_use_transparent_window = transparent_;
+
// Read icon before window is created.
options.Get(switches::kIcon, &icon_);
return dialog_manager_.get();
}
+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::BeforeUnloadFired(content::WebContents* tab,
bool proceed,
bool* proceed_to_fire_unload) {
void RendererResponsive(content::WebContents* source) override;
// Implementations of content::WebContentsObserver.
+ void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void BeforeUnloadFired(const base::TimeTicks& proceed_time) override;
bool OnMessageReceived(const IPC::Message& message) override;
// Whether window has standard frame.
bool has_frame_;
+ // Whether window is transparent.
+ bool transparent_;
+
// Whether window can be resized larger than screen.
bool enable_larger_than_screen_;