Messages from the browser process call atom.messageReceivedFromBrowserProcess

This is how we will handle replies from dialogs presented in the browser process.
This commit is contained in:
Nathan Sobo
2012-08-29 15:07:10 -05:00
parent 74bf4db5fc
commit fcc012eb11
7 changed files with 141 additions and 97 deletions

View File

@@ -8,6 +8,10 @@ atom.sendMessageToBrowserProcess = (name, data, callback) ->
messageId = messageIdCounter++
data.unshift(messageId)
pendingBrowserProcessCallbacks[messageId] = callback
originalSendMessageToBrowserProcess(name, data)
atom.receiveMessageFromBrowserProcess = (name, data) ->
console.log "RECEIVE MESSAGE IN JS", name, data
atom.open = (args...) ->
@sendMessageToBrowserProcess('open', args)
@@ -15,6 +19,3 @@ atom.open = (args...) ->
atom.confirm = (prompt, buttonsAndCallbacks...) ->
console.log prompt, buttonsAndCallbacks
atom.confirm "Are you sure?",
"Yes", (-> )
"No", (-> )