Remove the offscreen-render option
authorCheng Zhao <zcbenz@gmail.com>
Fri, 18 Sep 2015 04:15:13 +0000 (12:15 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 18 Sep 2015 04:15:13 +0000 (12:15 +0800)
We are going to move the APIs to WebContents

atom/browser/native_window.cc
atom/browser/native_window.h
atom/common/options_switches.cc
atom/common/options_switches.h

index b88c375..9121f0c 100644 (file)
@@ -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_)
index e7de4eb..5784743 100644 (file)
@@ -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_;
 
index 75688ec..2268a40 100644 (file)
@@ -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";
index 6ce6d7f..eb7842e 100644 (file)
@@ -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[];