Rename ATOM_ ipc event prefix to ELECTRON_
This commit is contained in:
parent
577480421d
commit
8d8d5878a3
11 changed files with 86 additions and 86 deletions
|
@ -38,30 +38,30 @@ var BrowserWindowProxy = (function () {
|
|||
function BrowserWindowProxy (guestId1) {
|
||||
this.guestId = guestId1
|
||||
this.closed = false
|
||||
ipcRenderer.once('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSED_' + this.guestId, () => {
|
||||
ipcRenderer.once('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_CLOSED_' + this.guestId, () => {
|
||||
BrowserWindowProxy.remove(this.guestId)
|
||||
this.closed = true
|
||||
})
|
||||
}
|
||||
|
||||
BrowserWindowProxy.prototype.close = function () {
|
||||
return ipcRenderer.send('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', this.guestId)
|
||||
return ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', this.guestId)
|
||||
}
|
||||
|
||||
BrowserWindowProxy.prototype.focus = function () {
|
||||
return ipcRenderer.send('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'focus')
|
||||
return ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'focus')
|
||||
}
|
||||
|
||||
BrowserWindowProxy.prototype.blur = function () {
|
||||
return ipcRenderer.send('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'blur')
|
||||
return ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'blur')
|
||||
}
|
||||
|
||||
Object.defineProperty(BrowserWindowProxy.prototype, 'location', {
|
||||
get: function () {
|
||||
return ipcRenderer.sendSync('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'getURL')
|
||||
return ipcRenderer.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'getURL')
|
||||
},
|
||||
set: function (url) {
|
||||
return ipcRenderer.sendSync('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'loadURL', url)
|
||||
return ipcRenderer.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', this.guestId, 'loadURL', url)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -69,11 +69,11 @@ var BrowserWindowProxy = (function () {
|
|||
if (targetOrigin == null) {
|
||||
targetOrigin = '*'
|
||||
}
|
||||
return ipcRenderer.send('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', this.guestId, message, targetOrigin, window.location.origin)
|
||||
return ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', this.guestId, message, targetOrigin, window.location.origin)
|
||||
}
|
||||
|
||||
BrowserWindowProxy.prototype['eval'] = function (...args) {
|
||||
return ipcRenderer.send.apply(ipcRenderer, ['ATOM_SHELL_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', this.guestId, 'executeJavaScript'].concat(args))
|
||||
return ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', this.guestId, 'executeJavaScript'].concat(args))
|
||||
}
|
||||
|
||||
return BrowserWindowProxy
|
||||
|
@ -147,7 +147,7 @@ window.open = function (url, frameName, features) {
|
|||
options[name] = parseInt(options[name], 10)
|
||||
}
|
||||
}
|
||||
guestId = ipcRenderer.sendSync('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', url, frameName, disposition, options)
|
||||
guestId = ipcRenderer.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', url, frameName, disposition, options)
|
||||
if (guestId) {
|
||||
return BrowserWindowProxy.getOrCreate(guestId)
|
||||
} else {
|
||||
|
@ -200,7 +200,7 @@ if (process.openerId != null) {
|
|||
window.opener = BrowserWindowProxy.getOrCreate(process.openerId)
|
||||
}
|
||||
|
||||
ipcRenderer.on('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', function (event, isVisible, isMinimized) {
|
||||
ipcRenderer.on('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', function (event, isVisible, isMinimized) {
|
||||
var hasChanged = _isVisible !== isVisible || _isMinimized !== isMinimized
|
||||
|
||||
if (hasChanged) {
|
||||
|
@ -211,7 +211,7 @@ ipcRenderer.on('ATOM_RENDERER_WINDOW_VISIBILITY_CHANGE', function (event, isVisi
|
|||
}
|
||||
})
|
||||
|
||||
ipcRenderer.on('ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', function (event, sourceId, message, sourceOrigin) {
|
||||
ipcRenderer.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (event, sourceId, message, sourceOrigin) {
|
||||
// Manually dispatch event instead of using postMessage because we also need to
|
||||
// set event.source.
|
||||
event = document.createEvent('Event')
|
||||
|
@ -224,11 +224,11 @@ ipcRenderer.on('ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', function (event, sourceId,
|
|||
|
||||
// Forward history operations to browser.
|
||||
var sendHistoryOperation = function (...args) {
|
||||
return ipcRenderer.send.apply(ipcRenderer, ['ATOM_SHELL_NAVIGATION_CONTROLLER'].concat(args))
|
||||
return ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_NAVIGATION_CONTROLLER'].concat(args))
|
||||
}
|
||||
|
||||
var getHistoryOperation = function (...args) {
|
||||
return ipcRenderer.sendSync.apply(ipcRenderer, ['ATOM_SHELL_SYNC_NAVIGATION_CONTROLLER'].concat(args))
|
||||
return ipcRenderer.sendSync.apply(ipcRenderer, ['ELECTRON_SYNC_NAVIGATION_CONTROLLER'].concat(args))
|
||||
}
|
||||
|
||||
window.history.back = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue