From 5459137d3d41e73935ff0ac617e8c09adb94d1d7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 9 Jun 2015 15:40:04 +0800 Subject: [PATCH] Remove unused options for WebContents.create --- atom/browser/api/atom_api_web_contents.cc | 8 +------- atom/browser/api/atom_api_web_contents.h | 3 --- atom/browser/lib/guest-view-manager.coffee | 4 +--- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 3d3cc78..9e1747b 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -117,7 +117,6 @@ WebContents::WebContents(brightray::InspectableWebContents* web_contents) WebContents::WebContents(content::WebContents* web_contents) : CommonWebContentsDelegate(false), content::WebContentsObserver(web_contents), - guest_instance_id_(-1), guest_opaque_(true), guest_host_(nullptr), auto_size_enabled_(false), @@ -127,21 +126,16 @@ WebContents::WebContents(content::WebContents* web_contents) WebContents::WebContents(const mate::Dictionary& options) : CommonWebContentsDelegate(true), - guest_instance_id_(-1), guest_opaque_(true), guest_host_(nullptr), auto_size_enabled_(false), is_full_page_plugin_(false) { - options.Get("guestInstanceId", &guest_instance_id_); - auto browser_context = AtomBrowserContext::Get(); content::SiteInstance* site_instance = content::SiteInstance::CreateForURL( browser_context, GURL("chrome-guest://fake-host")); content::WebContents::CreateParams params(browser_context, site_instance); - bool is_guest; - if (options.Get("isGuest", &is_guest) && is_guest) - params.guest_delegate = this; + params.guest_delegate = this; auto web_contents = content::WebContents::Create(params); InitWithWebContents(web_contents, GetWindowFromGuest(web_contents)); diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 58059d9..9e3016f 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -228,9 +228,6 @@ class WebContents : public mate::EventEmitter, // Returns the default size of the guestview. gfx::Size GetDefaultSize() const; - // Unique ID for a guest WebContents. - int guest_instance_id_; - // Stores whether the contents of the guest can be transparent. bool guest_opaque_; diff --git a/atom/browser/lib/guest-view-manager.coffee b/atom/browser/lib/guest-view-manager.coffee index 43624b8..ec13523 100644 --- a/atom/browser/lib/guest-view-manager.coffee +++ b/atom/browser/lib/guest-view-manager.coffee @@ -38,9 +38,7 @@ createGuest = (embedder, params) -> webViewManager ?= process.atomBinding 'web_view_manager' id = getNextInstanceId embedder - guest = webContents.create - isGuest: true - guestInstanceId: id + guest = webContents.create() guestInstances[id] = {guest, embedder} # Destroy guest when the embedder is gone or navigated. -- 2.7.4