Add MessageRegistry

The MessageRegistry is similar to the CommandRegistry in that it maps
string message types to callback functions; however, messages are
dispatched to Atom from outside the application using URIs, and so
should be more restrictive about what they allow.

Signed-off-by: Katrina Uychaco <kuychaco@github.com>
This commit is contained in:
Michelle Tilley
2016-04-06 17:04:16 -07:00
parent 82b75b5fbb
commit 3c14b8d771
7 changed files with 266 additions and 2 deletions

View File

@@ -235,6 +235,14 @@ class ApplicationDelegate
new Disposable ->
ipcRenderer.removeListener('context-command', outerCallback)
onUrlMessage: (callback) ->
outerCallback = (event, args...) ->
callback(args...)
ipcRenderer.on('url-message', outerCallback)
new Disposable ->
ipcRenderer.removeListener('url-message', outerCallback)
didCancelWindowUnload: ->
ipcRenderer.send('did-cancel-window-unload')