OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "device/devices_app/usb/fake_permission_provider.h" |
| 6 |
| 7 namespace device { |
| 8 namespace usb { |
| 9 |
| 10 FakePermissionProvider::FakePermissionProvider() {} |
| 11 |
| 12 FakePermissionProvider::~FakePermissionProvider() {} |
| 13 |
| 14 void FakePermissionProvider::HasDevicePermission( |
| 15 mojo::Array<DeviceInfoPtr> requested_devices, |
| 16 const HasDevicePermissionCallback& callback) { |
| 17 mojo::Array<mojo::String> allowed_guids(requested_devices.size()); |
| 18 for (size_t i = 0; i < requested_devices.size(); ++i) |
| 19 allowed_guids[i] = requested_devices[i]->guid; |
| 20 callback.Run(allowed_guids.Pass()); |
| 21 } |
| 22 |
| 23 void FakePermissionProvider::HasConfigurationPermission( |
| 24 uint8_t requested_configuration, |
| 25 device::usb::DeviceInfoPtr device, |
| 26 const HasInterfacePermissionCallback& callback) { |
| 27 callback.Run(true); |
| 28 } |
| 29 void FakePermissionProvider::HasInterfacePermission( |
| 30 uint8_t requested_interface, |
| 31 uint8_t configuration_value, |
| 32 device::usb::DeviceInfoPtr device, |
| 33 const HasInterfacePermissionCallback& callback) { |
| 34 callback.Run(true); |
| 35 } |
| 36 |
| 37 void FakePermissionProvider::Bind( |
| 38 mojo::InterfaceRequest<PermissionProvider> request) { |
| 39 bindings_.AddBinding(this, request.Pass()); |
| 40 } |
| 41 |
| 42 } // namespace usb |
| 43 } // namespace device |
OLD | NEW |