| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_U2F_U2F_HID_DEVICE_H_ | 5 #ifndef DEVICE_U2F_U2F_HID_DEVICE_H_ |
| 6 #define DEVICE_U2F_U2F_HID_DEVICE_H_ | 6 #define DEVICE_U2F_U2F_HID_DEVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "device/hid/hid_service.h" | 10 #include "device/hid/hid_service.h" |
| 11 #include "u2f_device.h" | 11 #include "u2f_device.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 class IOBuffer; | 14 class IOBuffer; |
| 15 } // namespace net | 15 } // namespace net |
| 16 | 16 |
| 17 namespace device { | 17 namespace device { |
| 18 | 18 |
| 19 class U2fMessage; | 19 class U2fMessage; |
| 20 class HidConnection; | 20 class HidConnection; |
| 21 class HidDeviceInfo; | 21 class HidDeviceInfo; |
| 22 | 22 |
| 23 class U2fHidDevice : public U2fDevice { | 23 class U2fHidDevice : public U2fDevice { |
| 24 public: | 24 public: |
| 25 U2fHidDevice(scoped_refptr<HidDeviceInfo>); | 25 U2fHidDevice(scoped_refptr<HidDeviceInfo>); |
| 26 ~U2fHidDevice(); | 26 ~U2fHidDevice() final; |
| 27 | 27 |
| 28 // Send a U2f command to this device | 28 // Send a U2f command to this device |
| 29 void DeviceTransact(std::unique_ptr<U2fApduCommand> command, | 29 void DeviceTransact(std::unique_ptr<U2fApduCommand> command, |
| 30 const DeviceCallback& callback) final; | 30 const DeviceCallback& callback) final; |
| 31 // Send a wink command if supported | 31 // Send a wink command if supported |
| 32 void TryWink(const WinkCallback& callback) final; | 32 void TryWink(const WinkCallback& callback) final; |
| 33 // Use a string identifier to compare to other devices | 33 // Use a string identifier to compare to other devices |
| 34 std::string GetId() final; | 34 std::string GetId() final; |
| 35 // Command line flag to enable tests on actual U2f HID hardware | 35 // Command line flag to enable tests on actual U2f HID hardware |
| 36 static bool IsTestEnabled(); | 36 static bool IsTestEnabled(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 scoped_refptr<HidDeviceInfo> device_info_; | 92 scoped_refptr<HidDeviceInfo> device_info_; |
| 93 scoped_refptr<HidConnection> connection_; | 93 scoped_refptr<HidConnection> connection_; |
| 94 base::WeakPtrFactory<U2fHidDevice> weak_factory_; | 94 base::WeakPtrFactory<U2fHidDevice> weak_factory_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(U2fHidDevice); | 96 DISALLOW_COPY_AND_ASSIGN(U2fHidDevice); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace device | 99 } // namespace device |
| 100 | 100 |
| 101 #endif // DEVICE_U2F_U2F_HID_DEVICE_H_ | 101 #endif // DEVICE_U2F_U2F_HID_DEVICE_H_ |
| OLD | NEW |