Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: device/devices_app/usb/fake_permission_provider.cc

Issue 1369643002: Add configuration and interface permission checks to DeviceImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add new method ot Android USB mocks. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698