michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: const {Cu} = require("chrome"); michael@0: const ObservableObject = require("devtools/shared/observable-object"); michael@0: const {Devices} = Cu.import("resource://gre/modules/devtools/Devices.jsm"); michael@0: michael@0: let store = new ObservableObject({versions:[]}); michael@0: michael@0: function feedStore() { michael@0: store.object.available = Devices.helperAddonInstalled; michael@0: store.object.devices = Devices.available().map(n => { michael@0: return {name:n} michael@0: }); michael@0: } michael@0: michael@0: Devices.on("register", feedStore); michael@0: Devices.on("unregister", feedStore); michael@0: Devices.on("addon-status-updated", feedStore); michael@0: michael@0: feedStore(); michael@0: michael@0: module.exports = store;