Chromium Code Reviews| Index: chrome/browser/resources/bluetooth_internals/interfaces.js |
| diff --git a/chrome/browser/resources/bluetooth_internals/interfaces.js b/chrome/browser/resources/bluetooth_internals/interfaces.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..391deacebed06636077e5ddef2727afff191ac68 |
| --- /dev/null |
| +++ b/chrome/browser/resources/bluetooth_internals/interfaces.js |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * Javascript for Mojo interface helpers, served from |
| + * chrome://bluetooth-internals/. |
| + */ |
| + |
| +cr.define('interfaces', function() { |
| + /** |
| + * Imports Mojo interfaces and adds them to window.interfaces. |
| + * @return {Promise} |
| + */ |
| + function importInterfaces() { |
| + return importModules([ |
| + 'content/public/renderer/frame_interfaces', |
| + 'device/bluetooth/public/interfaces/adapter.mojom', |
| + 'device/bluetooth/public/interfaces/device.mojom', |
| + 'mojo/public/js/connection', |
| + ]).then(function([frameInterfaces, bluetoothAdapter, bluetoothDevice, |
| + connection]) { |
| + Object.assign(interfaces, { |
|
Dan Beam
2016/11/09 18:00:32
this might require compiler integration as is more
mbrunson
2016/11/10 01:02:14
Done.
|
| + BluetoothAdapter: bluetoothAdapter, |
| + BluetoothDevice: bluetoothDevice, |
| + Connection: connection, |
| + FrameInterfaces: frameInterfaces, |
| + }); |
| + }); |
| + } |
| + |
| + return { |
| + BluetoothAdapter: {}, |
| + BluetoothDevice: {}, |
| + Connection: {}, |
| + FrameInterfaces: {}, |
|
Dan Beam
2016/11/09 18:00:32
what's going on with these {}?
mbrunson
2016/11/10 01:02:14
It was a hint that these values were going to be e
|
| + importInterfaces: importInterfaces, |
| + }; |
| +}); |