Move "restart()" API to webContents.
This commit is contained in:
parent
8342c7cfe1
commit
19698fc739
2 changed files with 5 additions and 3 deletions
|
@ -51,9 +51,6 @@ BrowserWindow::getWebContents = ->
|
||||||
BrowserWindow::getDevToolsWebContents = ->
|
BrowserWindow::getDevToolsWebContents = ->
|
||||||
wrapWebContents @_getDevToolsWebContents()
|
wrapWebContents @_getDevToolsWebContents()
|
||||||
|
|
||||||
BrowserWindow::restart = ->
|
|
||||||
@loadUrl(@getUrl())
|
|
||||||
|
|
||||||
BrowserWindow::setMenu = (menu) ->
|
BrowserWindow::setMenu = (menu) ->
|
||||||
if process.platform is 'darwin'
|
if process.platform is 'darwin'
|
||||||
throw new Error('BrowserWindow.setMenu is not available on OS X')
|
throw new Error('BrowserWindow.setMenu is not available on OS X')
|
||||||
|
@ -84,6 +81,7 @@ BrowserWindow::loadUrl = -> @webContents.loadUrl.apply @webContents, arguments
|
||||||
BrowserWindow::send = -> @webContents.send.apply @webContents, arguments
|
BrowserWindow::send = -> @webContents.send.apply @webContents, arguments
|
||||||
|
|
||||||
# Be compatible with old API.
|
# Be compatible with old API.
|
||||||
|
BrowserWindow::restart = -> @webContents.restart()
|
||||||
BrowserWindow::getUrl = -> @webContents.getUrl()
|
BrowserWindow::getUrl = -> @webContents.getUrl()
|
||||||
BrowserWindow::reload = -> @webContents.reload()
|
BrowserWindow::reload = -> @webContents.reload()
|
||||||
BrowserWindow::reloadIgnoringCache = -> @webContents.reloadIgnoringCache()
|
BrowserWindow::reloadIgnoringCache = -> @webContents.reloadIgnoringCache()
|
||||||
|
|
|
@ -11,6 +11,10 @@ module.exports.wrap = (webContents) ->
|
||||||
webContents.send = (args...) ->
|
webContents.send = (args...) ->
|
||||||
@_send 'ATOM_INTERNAL_MESSAGE', [args...]
|
@_send 'ATOM_INTERNAL_MESSAGE', [args...]
|
||||||
|
|
||||||
|
# WebContents::restart()
|
||||||
|
# Restart the renderer process.
|
||||||
|
webContents.restart = -> @loadUrl @getUrl()
|
||||||
|
|
||||||
# The processId and routingId and identify a webContents.
|
# The processId and routingId and identify a webContents.
|
||||||
webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}"
|
webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}"
|
||||||
webContents.equal = (other) -> @getId() is other.getId()
|
webContents.equal = (other) -> @getId() is other.getId()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue