2016-03-24 20:15:04 +00:00
|
|
|
const deprecate = require('electron').deprecate
|
|
|
|
const EventEmitter = require('events').EventEmitter
|
|
|
|
const Tray = process.atomBinding('tray').Tray
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-03-24 20:15:04 +00:00
|
|
|
Tray.prototype.__proto__ = EventEmitter.prototype
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-03-24 20:15:04 +00:00
|
|
|
Tray.prototype._init = function () {
|
2016-01-14 18:35:29 +00:00
|
|
|
// Deprecated.
|
2016-03-24 20:15:04 +00:00
|
|
|
deprecate.rename(this, 'popContextMenu', 'popUpContextMenu')
|
|
|
|
deprecate.event(this, 'clicked', 'click')
|
|
|
|
deprecate.event(this, 'double-clicked', 'double-click')
|
|
|
|
deprecate.event(this, 'right-clicked', 'right-click')
|
|
|
|
return deprecate.event(this, 'balloon-clicked', 'balloon-click')
|
|
|
|
}
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-03-24 20:15:04 +00:00
|
|
|
Tray.prototype.setContextMenu = function (menu) {
|
|
|
|
this._setContextMenu(menu)
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-01-14 18:35:29 +00:00
|
|
|
// Keep a strong reference of menu.
|
2016-03-24 20:15:04 +00:00
|
|
|
return this.menu = menu
|
|
|
|
}
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-03-24 20:15:04 +00:00
|
|
|
module.exports = Tray
|