Fixes after code review.
This commit is contained in:
parent
e8d648bcba
commit
dbbc35bd13
2 changed files with 15 additions and 17 deletions
|
@ -5,11 +5,9 @@ remote = require 'remote'
|
|||
# Window object returned by "window.open".
|
||||
class FakeWindow
|
||||
constructor: (@guestId) ->
|
||||
that = this
|
||||
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSED', (guestId) ->
|
||||
if guestId is that.guestId
|
||||
that.closed = true
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSED', (guestId) =>
|
||||
if guestId is @guestId
|
||||
@closed = true
|
||||
|
||||
close: ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', @guestId
|
||||
|
@ -20,8 +18,8 @@ class FakeWindow
|
|||
blur: ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', @guestId, 'blur'
|
||||
|
||||
postMessage: (args...) ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', @guestId, 'postMessage', args[0], args[1]
|
||||
postMessage: (message, targetOrigin) ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', @guestId, message, targetOrigin
|
||||
|
||||
eval: (args...) ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', @guestId, 'executeJavaScript', args...
|
||||
|
@ -73,8 +71,8 @@ window.prompt = ->
|
|||
throw new Error('prompt() is and will not be supported in atom-shell.')
|
||||
|
||||
window.opener =
|
||||
postMessage: (args...) ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', 'postMessage', args[0], args[1]
|
||||
postMessage: (message, targetOrigin) ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', message, targetOrigin
|
||||
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', (data, origin) ->
|
||||
window.postMessage(data, origin)
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', (message, targetOrigin) ->
|
||||
window.postMessage(message, targetOrigin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue