2016-05-15 13:41:30 +00:00
|
|
|
const {EventEmitter} = require('events')
|
2018-02-21 04:30:32 +00:00
|
|
|
const {deprecate} = require('electron')
|
2016-05-15 13:41:30 +00:00
|
|
|
const {Tray} = process.atomBinding('tray')
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-03-29 00:51:11 +00:00
|
|
|
Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype)
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2018-02-21 04:30:32 +00:00
|
|
|
// TODO(codebytere): remove in 3.0
|
|
|
|
const nativeSetHighlightMode = Tray.prototype.setHighlightMode
|
|
|
|
Tray.prototype.setHighlightMode = function (param) {
|
|
|
|
if (!process.noDeprecations && typeof param === 'boolean') {
|
|
|
|
if (param) {
|
|
|
|
deprecate.warn('tray.setHighlightMode(true)', `tray.setHighlightMode("on")`)
|
|
|
|
} else {
|
|
|
|
deprecate.warn('tray.setHighlightMode(false)', `tray.setHighlightMode("off")`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nativeSetHighlightMode.call(this, param)
|
|
|
|
}
|
|
|
|
|
2016-03-24 20:15:04 +00:00
|
|
|
module.exports = Tray
|