| 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 /** @const */ var Page = cr.ui.pageManager.Page; | 6 /** @const */ var Page = cr.ui.pageManager.Page; |
| 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Enumeration of possible states during pairing. The value associated with | 10 * Enumeration of possible states during pairing. The value associated with |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 }, | 146 }, |
| 147 | 147 |
| 148 /** | 148 /** |
| 149 * Override to prevent showing the overlay if the Bluetooth device details | 149 * Override to prevent showing the overlay if the Bluetooth device details |
| 150 * have not been specified. Prevents showing an empty dialog if the user | 150 * have not been specified. Prevents showing an empty dialog if the user |
| 151 * quits and restarts Chrome while in the process of pairing with a device. | 151 * quits and restarts Chrome while in the process of pairing with a device. |
| 152 * @return {boolean} True if the overlay can be displayed. | 152 * @return {boolean} True if the overlay can be displayed. |
| 153 */ | 153 */ |
| 154 canShowPage: function() { | 154 canShowPage: function() { |
| 155 return this.device_ && this.device_.address && this.device_.pairing; | 155 return !!(this.device_ && this.device_.address && this.device_.pairing); |
| 156 }, | 156 }, |
| 157 | 157 |
| 158 /** | 158 /** |
| 159 * Sets input focus on the passkey or pincode field if appropriate. | 159 * Sets input focus on the passkey or pincode field if appropriate. |
| 160 */ | 160 */ |
| 161 didShowPage: function() { | 161 didShowPage: function() { |
| 162 if (!$('bluetooth-pincode').hidden) | 162 if (!$('bluetooth-pincode').hidden) |
| 163 $('bluetooth-pincode').focus(); | 163 $('bluetooth-pincode').focus(); |
| 164 else if (!$('bluetooth-passkey').hidden) | 164 else if (!$('bluetooth-passkey').hidden) |
| 165 $('bluetooth-passkey').focus(); | 165 $('bluetooth-passkey').focus(); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 dialog.device_.pairing = PAIRING.DISMISSED; | 375 dialog.device_.pairing = PAIRING.DISMISSED; |
| 376 PageManager.closeOverlay(); | 376 PageManager.closeOverlay(); |
| 377 } | 377 } |
| 378 }; | 378 }; |
| 379 | 379 |
| 380 // Export | 380 // Export |
| 381 return { | 381 return { |
| 382 BluetoothPairing: BluetoothPairing | 382 BluetoothPairing: BluetoothPairing |
| 383 }; | 383 }; |
| 384 }); | 384 }); |
| OLD | NEW |