OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(dbeam): should these be global like this? | 5 // TODO(dbeam): should these be global like this? |
6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
8 var BluetoothPairing = options.BluetoothPairing; | 8 var BluetoothPairing = options.BluetoothPairing; |
9 | 9 |
10 /** @override */ | 10 /** @override */ |
(...skipping 14 matching lines...) Expand all Loading... |
25 */ | 25 */ |
26 cr.define('options', function() { | 26 cr.define('options', function() { |
27 function BluetoothOptions() {} | 27 function BluetoothOptions() {} |
28 | 28 |
29 BluetoothOptions.startDeviceDiscovery = function() {}; | 29 BluetoothOptions.startDeviceDiscovery = function() {}; |
30 BluetoothOptions.updateDiscoveryState = function() {}; | 30 BluetoothOptions.updateDiscoveryState = function() {}; |
31 BluetoothOptions.dismissOverlay = function() { | 31 BluetoothOptions.dismissOverlay = function() { |
32 PageManager.closeOverlay(); | 32 PageManager.closeOverlay(); |
33 }; | 33 }; |
34 | 34 |
35 return { | 35 return {BluetoothOptions: BluetoothOptions}; |
36 BluetoothOptions: BluetoothOptions | |
37 }; | |
38 }); | 36 }); |
39 | 37 |
40 /** | 38 /** |
41 * DOMContentLoaded handler, sets up the page. | 39 * DOMContentLoaded handler, sets up the page. |
42 */ | 40 */ |
43 function load() { | 41 function load() { |
44 if (cr.isChromeOS) | 42 if (cr.isChromeOS) |
45 document.documentElement.setAttribute('os', 'chromeos'); | 43 document.documentElement.setAttribute('os', 'chromeos'); |
46 | 44 |
47 // Decorate the existing elements in the document. | 45 // Decorate the existing elements in the document. |
(...skipping 24 matching lines...) Expand all Loading... |
72 chrome.bluetoothPrivate.onPairing.addListener( | 70 chrome.bluetoothPrivate.onPairing.addListener( |
73 BluetoothPairing.onBluetoothPairingEvent); | 71 BluetoothPairing.onBluetoothPairingEvent); |
74 | 72 |
75 // Show the BluetoothPairing dialog. | 73 // Show the BluetoothPairing dialog. |
76 var args = JSON.parse(chrome.getVariableValue('dialogArguments')); | 74 var args = JSON.parse(chrome.getVariableValue('dialogArguments')); |
77 var device = /** @type {!chrome.bluetooth.Device} */ (args); | 75 var device = /** @type {!chrome.bluetooth.Device} */ (args); |
78 BluetoothPairing.connect(device, true); | 76 BluetoothPairing.connect(device, true); |
79 } | 77 } |
80 | 78 |
81 document.addEventListener('DOMContentLoaded', load); | 79 document.addEventListener('DOMContentLoaded', load); |
OLD | NEW |