Chromium Code Reviews| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 // may be authenticated. The DismissDisplayOrConfirm() method will be | 116 // may be authenticated. The DismissDisplayOrConfirm() method will be |
| 117 // called to dismiss the display once pairing is complete or cancelled. | 117 // called to dismiss the display once pairing is complete or cancelled. |
| 118 // | 118 // |
| 119 // This is used for Bluetooth 2.1 and later devices that support input | 119 // This is used for Bluetooth 2.1 and later devices that support input |
| 120 // but not display, such as keyboards. The Passkey is a numeric in the | 120 // but not display, such as keyboards. The Passkey is a numeric in the |
| 121 // range 0-999999 and should be always presented zero-padded to six | 121 // range 0-999999 and should be always presented zero-padded to six |
| 122 // digits. | 122 // digits. |
| 123 virtual void DisplayPasskey(BluetoothDevice* device, | 123 virtual void DisplayPasskey(BluetoothDevice* device, |
| 124 uint32 passkey) = 0; | 124 uint32 passkey) = 0; |
| 125 | 125 |
| 126 // This method will be called when the Bluetooth daemon gets a notification | |
| 127 // of a key entered in the device |device| while pairing with the device | |
|
keybuk
2013/04/17 23:43:37
nit: "on" the device
deymo
2013/04/18 00:26:01
Done.
| |
| 128 // using a PIN code or a Passkey. This method will be called only after | |
|
keybuk
2013/04/17 23:43:37
nit: paragraph/line break here to de-dense the tex
deymo
2013/04/18 00:26:01
Right now, with the current BlueZ, no, it is never
| |
| 129 // DisplayPinCode() or DisplayPasskey() is called and before the | |
| 130 // corresponding DismissDisplayOrConfirm() is called, but is not warrantied | |
|
keybuk
2013/04/17 23:43:37
nit: warranted
deymo
2013/04/18 00:26:01
Done.
| |
| 131 // to be called on every pairing process that requires a PIN code or a | |
| 132 // Passkey because some device may not support this feature. | |
| 133 // The |entered| value describes the number of keys entered so far, | |
|
keybuk
2013/04/17 23:43:37
nit: paragraph/line break before this one
deymo
2013/04/18 00:26:01
Done.
| |
| 134 // including the last [enter] key. A first call to DisplayEnteredKeys() with | |
| 135 // |entered| as 0 will be effectuated when the device supports this feature. | |
|
keybuk
2013/04/17 23:43:37
Isn't this only supported by DisplayPasskey?
Or a
keybuk
2013/04/17 23:43:37
nit: replace effectuated with "sent" :)
deymo
2013/04/18 00:26:01
Yes, apple keyboard could be supported eventually
| |
| 136 virtual void DisplayEnteredKeys(BluetoothDevice* device, | |
| 137 uint32 entered) = 0; | |
| 138 | |
| 126 // This method will be called when the Bluetooth daemon requires that the | 139 // This method will be called when the Bluetooth daemon requires that the |
| 127 // user confirm that the Passkey |passkey| is displayed on the screen | 140 // user confirm that the Passkey |passkey| is displayed on the screen |
| 128 // of the device |device| so that it may be authenticated. The delegate | 141 // of the device |device| so that it may be authenticated. The delegate |
| 129 // should display to the user and ask for confirmation, then call | 142 // should display to the user and ask for confirmation, then call |
| 130 // ConfirmPairing() on the device to confirm, RejectPairing() on the device | 143 // ConfirmPairing() on the device to confirm, RejectPairing() on the device |
| 131 // to reject or CancelPairing() on the device to cancel authentication | 144 // to reject or CancelPairing() on the device to cancel authentication |
| 132 // for any other reason. | 145 // for any other reason. |
| 133 // | 146 // |
| 134 // This is used for Bluetooth 2.1 and later devices that support display, | 147 // This is used for Bluetooth 2.1 and later devices that support display, |
| 135 // such as other computers or phones. The Passkey is a numeric in the | 148 // such as other computers or phones. The Passkey is a numeric in the |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 | 335 |
| 323 private: | 336 private: |
| 324 // Returns a localized string containing the device's bluetooth address and | 337 // Returns a localized string containing the device's bluetooth address and |
| 325 // a device type for display when |name_| is empty. | 338 // a device type for display when |name_| is empty. |
| 326 string16 GetAddressWithLocalizedDeviceTypeName() const; | 339 string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 327 }; | 340 }; |
| 328 | 341 |
| 329 } // namespace device | 342 } // namespace device |
| 330 | 343 |
| 331 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 344 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |