Move "id" and "fromId" to C++
This commit is contained in:
parent
c2f14e6053
commit
5e62b5975b
4 changed files with 15 additions and 13 deletions
|
@ -15,11 +15,6 @@ BrowserWindow::_init = ->
|
|||
menu = app.getApplicationMenu()
|
||||
@setMenu menu if menu?
|
||||
|
||||
# Remember the window ID.
|
||||
Object.defineProperty this, 'id',
|
||||
value: BrowserWindow.windows.add(this)
|
||||
enumerable: true
|
||||
|
||||
# Make new windows requested by links behave like "window.open"
|
||||
@on '-new-window', (event, url, frameName) =>
|
||||
event.sender = @webContents
|
||||
|
@ -63,9 +58,6 @@ BrowserWindow.fromDevToolsWebContents = (webContents) ->
|
|||
windows = BrowserWindow.getAllWindows()
|
||||
return window for window in windows when window.devToolsWebContents?.equal webContents
|
||||
|
||||
BrowserWindow.fromId = (id) ->
|
||||
BrowserWindow.windows.get id if BrowserWindow.windows.has id
|
||||
|
||||
# Helpers.
|
||||
BrowserWindow::loadUrl = -> @webContents.loadUrl.apply @webContents, arguments
|
||||
BrowserWindow::send = -> @webContents.send.apply @webContents, arguments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue