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..64a613ba2fa752e7e3c445adf681756163ac0791 |
| --- /dev/null |
| +++ b/chrome/browser/resources/bluetooth_internals/interfaces.js |
| @@ -0,0 +1,35 @@ |
| +// 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, { |
| + BluetoothAdapter: bluetoothAdapter, |
|
dpapad
2016/11/04 17:20:00
FYI, If this code was to every be compiled by Clos
mbrunson
2016/11/04 22:57:41
I've exported some empty objects and the test pass
dpapad
2016/11/04 23:43:51
Not sure what test you are referring to. Compiler
|
| + BluetoothDevice: bluetoothDevice, |
| + Connection: connection, |
| + FrameInterfaces: frameInterfaces, |
| + }); |
| + }); |
| + } |
| + |
| + return { |
| + importInterfaces: importInterfaces, |
| + }; |
| +}); |