Remove unused options for WebContents.create

This commit is contained in:
Cheng Zhao 2015-06-09 15:40:04 +08:00
parent 89087d402d
commit 5459137d3d
3 changed files with 2 additions and 13 deletions

View file

@ -117,7 +117,6 @@ WebContents::WebContents(brightray::InspectableWebContents* web_contents)
WebContents::WebContents(content::WebContents* web_contents) WebContents::WebContents(content::WebContents* web_contents)
: CommonWebContentsDelegate(false), : CommonWebContentsDelegate(false),
content::WebContentsObserver(web_contents), content::WebContentsObserver(web_contents),
guest_instance_id_(-1),
guest_opaque_(true), guest_opaque_(true),
guest_host_(nullptr), guest_host_(nullptr),
auto_size_enabled_(false), auto_size_enabled_(false),
@ -127,20 +126,15 @@ WebContents::WebContents(content::WebContents* web_contents)
WebContents::WebContents(const mate::Dictionary& options) WebContents::WebContents(const mate::Dictionary& options)
: CommonWebContentsDelegate(true), : CommonWebContentsDelegate(true),
guest_instance_id_(-1),
guest_opaque_(true), guest_opaque_(true),
guest_host_(nullptr), guest_host_(nullptr),
auto_size_enabled_(false), auto_size_enabled_(false),
is_full_page_plugin_(false) { is_full_page_plugin_(false) {
options.Get("guestInstanceId", &guest_instance_id_);
auto browser_context = AtomBrowserContext::Get(); auto browser_context = AtomBrowserContext::Get();
content::SiteInstance* site_instance = content::SiteInstance::CreateForURL( content::SiteInstance* site_instance = content::SiteInstance::CreateForURL(
browser_context, GURL("chrome-guest://fake-host")); browser_context, GURL("chrome-guest://fake-host"));
content::WebContents::CreateParams params(browser_context, site_instance); 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); auto web_contents = content::WebContents::Create(params);

View file

@ -228,9 +228,6 @@ class WebContents : public mate::EventEmitter,
// Returns the default size of the guestview. // Returns the default size of the guestview.
gfx::Size GetDefaultSize() const; gfx::Size GetDefaultSize() const;
// Unique ID for a guest WebContents.
int guest_instance_id_;
// Stores whether the contents of the guest can be transparent. // Stores whether the contents of the guest can be transparent.
bool guest_opaque_; bool guest_opaque_;

View file

@ -38,9 +38,7 @@ createGuest = (embedder, params) ->
webViewManager ?= process.atomBinding 'web_view_manager' webViewManager ?= process.atomBinding 'web_view_manager'
id = getNextInstanceId embedder id = getNextInstanceId embedder
guest = webContents.create guest = webContents.create()
isGuest: true
guestInstanceId: id
guestInstances[id] = {guest, embedder} guestInstances[id] = {guest, embedder}
# Destroy guest when the embedder is gone or navigated. # Destroy guest when the embedder is gone or navigated.