OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_USB_FAKE_PERMISSION_PROVIDER_H_ | 5 #ifndef DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ |
6 #define DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ | 6 #define DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "device/usb/public/interfaces/permission_provider.mojom.h" | 10 #include "device/usb/public/interfaces/permission_provider.mojom.h" |
11 #include "mojo/public/cpp/bindings/array.h" | 11 #include "mojo/public/cpp/bindings/array.h" |
| 12 #include "mojo/public/cpp/bindings/binding_set.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 13 #include "mojo/public/cpp/bindings/interface_request.h" |
13 #include "mojo/public/cpp/bindings/weak_binding_set.h" | |
14 | 14 |
15 namespace device { | 15 namespace device { |
16 namespace usb { | 16 namespace usb { |
17 | 17 |
18 class FakePermissionProvider : public PermissionProvider { | 18 class FakePermissionProvider : public PermissionProvider { |
19 public: | 19 public: |
20 FakePermissionProvider(); | 20 FakePermissionProvider(); |
21 ~FakePermissionProvider() override; | 21 ~FakePermissionProvider() override; |
22 | 22 |
23 void HasDevicePermission( | 23 void HasDevicePermission( |
24 mojo::Array<DeviceInfoPtr> requested_devices, | 24 mojo::Array<DeviceInfoPtr> requested_devices, |
25 const HasDevicePermissionCallback& callback) override; | 25 const HasDevicePermissionCallback& callback) override; |
26 void HasConfigurationPermission( | 26 void HasConfigurationPermission( |
27 uint8_t requested_configuration, | 27 uint8_t requested_configuration, |
28 device::usb::DeviceInfoPtr device, | 28 device::usb::DeviceInfoPtr device, |
29 const HasInterfacePermissionCallback& callback) override; | 29 const HasInterfacePermissionCallback& callback) override; |
30 void HasInterfacePermission( | 30 void HasInterfacePermission( |
31 uint8_t requested_interface, | 31 uint8_t requested_interface, |
32 uint8_t configuration_value, | 32 uint8_t configuration_value, |
33 device::usb::DeviceInfoPtr device, | 33 device::usb::DeviceInfoPtr device, |
34 const HasInterfacePermissionCallback& callback) override; | 34 const HasInterfacePermissionCallback& callback) override; |
35 void Bind(mojo::InterfaceRequest<PermissionProvider> request) override; | 35 void Bind(mojo::InterfaceRequest<PermissionProvider> request) override; |
36 | 36 |
37 private: | 37 private: |
38 mojo::WeakBindingSet<PermissionProvider> bindings_; | 38 mojo::BindingSet<PermissionProvider> bindings_; |
39 }; | 39 }; |
40 | 40 |
41 } // namespace usb | 41 } // namespace usb |
42 } // namespace device | 42 } // namespace device |
43 | 43 |
44 #endif // DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ | 44 #endif // DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ |
OLD | NEW |