From d7bac5a10b252c17ffe060840ea26dd275005e76 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 18 Sep 2015 12:15:13 +0800 Subject: [PATCH] Remove the offscreen-render option We are going to move the APIs to WebContents --- atom/browser/native_window.cc | 11 ----------- atom/browser/native_window.h | 3 --- atom/common/options_switches.cc | 2 -- atom/common/options_switches.h | 2 -- 4 files changed, 18 deletions(-) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index b88c3757..9121f0cb 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -167,9 +167,6 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) { options.Get(switches::kTitle, &title); SetTitle(title); - offscreen_ = false; - options.Get(switches::kOffScreenRender, &offscreen_); - // Then show it. bool show = true; options.Get(switches::kShow, &show); @@ -297,8 +294,6 @@ void NativeWindow::CapturePage(const gfx::Rect& rect, } void NativeWindow::SetFrameSubscription(bool isOffscreen) { - if (!isOffscreen && !offscreen_) return; - const auto view = web_contents()->GetRenderWidgetHostView(); if (view) { @@ -314,8 +309,6 @@ void NativeWindow::SetFrameSubscription(bool isOffscreen) { } else { view->EndFrameSubscription(); } - - offscreen_ = isOffscreen; } } @@ -520,10 +513,6 @@ void NativeWindow::SendMouseWheelEvent(int modifiers, int x, int y, bool precise host->ForwardWheelEvent(*wheel_event); } -void NativeWindow::DidFinishLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url) { - SetFrameSubscription(offscreen_); -} - void NativeWindow::RenderViewCreated( content::RenderViewHost* render_view_host) { if (!transparent_) diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index e7de4ebc..5784743a 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -246,7 +246,6 @@ class NativeWindow : public content::WebContentsObserver, // content::WebContentsObserver: void RenderViewCreated(content::RenderViewHost* render_view_host) override; - void DidFinishLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url) override; void BeforeUnloadDialogCancelled() override; void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override; bool OnMessageReceived(const IPC::Message& message) override; @@ -267,8 +266,6 @@ class NativeWindow : public content::WebContentsObserver, const SkBitmap& bitmap, content::ReadbackResponse response); - bool offscreen_; - // Whether window has standard frame. bool has_frame_; diff --git a/atom/common/options_switches.cc b/atom/common/options_switches.cc index 75688ec4..2268a403 100644 --- a/atom/common/options_switches.cc +++ b/atom/common/options_switches.cc @@ -116,8 +116,6 @@ const char kRegisterStandardSchemes[] = "register-standard-schemes"; // The browser process app model ID const char kAppUserModelId[] = "app-user-model-id"; -const char kOffScreenRender[] = "offscreen-render"; - const char kModifiers[] = "modifiers"; const char kKeyCode[] = "code"; const char kNativeKeyCode[] = "native"; diff --git a/atom/common/options_switches.h b/atom/common/options_switches.h index 6ce6d7f4..eb7842e7 100644 --- a/atom/common/options_switches.h +++ b/atom/common/options_switches.h @@ -62,8 +62,6 @@ extern const char kRegisterStandardSchemes[]; extern const char kAppUserModelId[]; -extern const char kOffScreenRender[]; - extern const char kModifiers[]; extern const char kKeyCode[]; extern const char kNativeKeyCode[]; -- 2.43.0