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..1bdbbdbc55f0f71928e78f080b1ce507820ae0ab |
--- /dev/null |
+++ b/chrome/browser/resources/bluetooth_internals/interfaces.js |
@@ -0,0 +1,36 @@ |
+// 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() { |
+ /** |
+ * Initializes Mojo proxies for page and Bluetooth services. Adds Mojo |
ortuno
2016/11/04 01:44:09
Fix comment since this is no longer initializing p
mbrunson
2016/11/04 02:37:40
Done.
|
+ * interfaces to window.interfaces. |
+ * @return {Promise} |
+ */ |
+ function initializeProxies() { |
ortuno
2016/11/04 01:44:10
nit: rename this to retrieve interfaces since you
mbrunson
2016/11/04 02:37:40
Done.
|
+ 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, |
+ BluetoothDevice: bluetoothDevice, |
+ Connection: connection, |
+ FrameInterfaces: frameInterfaces, |
+ }); |
+ }); |
+ } |
+ |
+ return { |
+ initialize: initializeProxies, |
ortuno
2016/11/04 01:44:10
Maybe retrieve since you are no longer initializin
mbrunson
2016/11/04 02:37:40
Done.
|
+ }; |
+}); |