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 on the device |device| while pairing with the device |
| 128 // using a PIN code or a Passkey. |
| 129 // |
| 130 // This method will be called only after DisplayPinCode() or |
| 131 // DisplayPasskey() is called and before the corresponding |
| 132 // DismissDisplayOrConfirm() is called, but is not warranted to be called |
| 133 // on every pairing process that requires a PIN code or a Passkey because |
| 134 // some device may not support this feature. |
| 135 // |
| 136 // The |entered| value describes the number of keys entered so far, |
| 137 // including the last [enter] key. A first call to KeysEntered() with |
| 138 // |entered| as 0 will be sent when the device supports this feature. |
| 139 virtual void KeysEntered(BluetoothDevice* device, |
| 140 uint32 entered) = 0; |
| 141 |
126 // This method will be called when the Bluetooth daemon requires that the | 142 // This method will be called when the Bluetooth daemon requires that the |
127 // user confirm that the Passkey |passkey| is displayed on the screen | 143 // user confirm that the Passkey |passkey| is displayed on the screen |
128 // of the device |device| so that it may be authenticated. The delegate | 144 // of the device |device| so that it may be authenticated. The delegate |
129 // should display to the user and ask for confirmation, then call | 145 // should display to the user and ask for confirmation, then call |
130 // ConfirmPairing() on the device to confirm, RejectPairing() on the device | 146 // ConfirmPairing() on the device to confirm, RejectPairing() on the device |
131 // to reject or CancelPairing() on the device to cancel authentication | 147 // to reject or CancelPairing() on the device to cancel authentication |
132 // for any other reason. | 148 // for any other reason. |
133 // | 149 // |
134 // This is used for Bluetooth 2.1 and later devices that support display, | 150 // 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 | 151 // such as other computers or phones. The Passkey is a numeric in the |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 342 |
327 private: | 343 private: |
328 // Returns a localized string containing the device's bluetooth address and | 344 // Returns a localized string containing the device's bluetooth address and |
329 // a device type for display when |name_| is empty. | 345 // a device type for display when |name_| is empty. |
330 string16 GetAddressWithLocalizedDeviceTypeName() const; | 346 string16 GetAddressWithLocalizedDeviceTypeName() const; |
331 }; | 347 }; |
332 | 348 |
333 } // namespace device | 349 } // namespace device |
334 | 350 |
335 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 351 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
OLD | NEW |