| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 | 6 |
| 7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
| 8 | 8 |
| 9 // | 9 // |
| 10 // AdvancedOptions class | 10 // AdvancedOptions class |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 */ | 422 */ |
| 423 AdvancedOptions.setBluetoothState = function(checked) { | 423 AdvancedOptions.setBluetoothState = function(checked) { |
| 424 $('enable-bluetooth').checked = checked; | 424 $('enable-bluetooth').checked = checked; |
| 425 $('bluetooth-paired-devices-list').parentNode.hidden = !checked; | 425 $('bluetooth-paired-devices-list').parentNode.hidden = !checked; |
| 426 $('bluetooth-add-device').hidden = !checked; | 426 $('bluetooth-add-device').hidden = !checked; |
| 427 $('bluetooth-reconnect-device').hidden = !checked; | 427 $('bluetooth-reconnect-device').hidden = !checked; |
| 428 // Flush list of previously discovered devices if bluetooth is turned off. | 428 // Flush list of previously discovered devices if bluetooth is turned off. |
| 429 if (!checked) { | 429 if (!checked) { |
| 430 $('bluetooth-paired-devices-list').clear(); | 430 $('bluetooth-paired-devices-list').clear(); |
| 431 $('bluetooth-unpaired-devices-list').clear(); | 431 $('bluetooth-unpaired-devices-list').clear(); |
| 432 } else { |
| 433 chrome.send('getPairedBluetoothDevices'); |
| 432 } | 434 } |
| 433 } | 435 } |
| 434 | 436 |
| 435 /** | 437 /** |
| 436 * Adds an element to the list of available bluetooth devices. If an element | 438 * Adds an element to the list of available bluetooth devices. If an element |
| 437 * with a matching address is found, the existing element is updated. | 439 * with a matching address is found, the existing element is updated. |
| 438 * @param {{name: string, | 440 * @param {{name: string, |
| 439 * address: string, | 441 * address: string, |
| 440 * icon: string, | 442 * icon: string, |
| 441 * paired: boolean, | 443 * paired: boolean, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 459 if (device.pairing) | 461 if (device.pairing) |
| 460 BluetoothPairing.showDialog(device); | 462 BluetoothPairing.showDialog(device); |
| 461 }; | 463 }; |
| 462 | 464 |
| 463 // Export | 465 // Export |
| 464 return { | 466 return { |
| 465 AdvancedOptions: AdvancedOptions | 467 AdvancedOptions: AdvancedOptions |
| 466 }; | 468 }; |
| 467 | 469 |
| 468 }); | 470 }); |
| OLD | NEW |