Move some APIs from Window to WebContents.

This commit is contained in:
Cheng Zhao 2014-04-24 17:00:41 +08:00
parent 26e93e8798
commit 79babe858d
5 changed files with 67 additions and 52 deletions

View file

@ -14,6 +14,8 @@ BrowserWindow::_init = ->
menu = app.getApplicationMenu()
@setMenu menu if menu?
@webContents = @getWebContents()
# Remember the window.
id = BrowserWindow.windows.add this
@ -62,4 +64,14 @@ BrowserWindow.fromDevTools = (processId, routingId) ->
return window if devtools.processId == processId and
devtools.routingId == routingId
# Be compatible with old API.
BrowserWindow::getUrl = -> @webContents.getUrl()
BrowserWindow::getPageTitle = -> @webContents.getTitle()
BrowserWindow::isLoading = -> @webContents.isLoading()
BrowserWindow::isWaitingForResponse = -> @webContents.isWaitingForResponse()
BrowserWindow::stop = -> @webContents.stop()
BrowserWindow::getRoutingId = -> @webContents.getRoutingId()
BrowserWindow::getProcessId = -> @webContents.getProcessId()
BrowserWindow::isCrashed = -> @webContents.isCrashed()
module.exports = BrowserWindow