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

Unified Diff: device/devices_app/usb/fake_permission_provider.h

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 side-by-side diff with in-line comments
Download patch
Index: device/devices_app/usb/fake_permission_provider.h
diff --git a/device/devices_app/usb/fake_permission_provider.h b/device/devices_app/usb/fake_permission_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..738ecbc377ace246f9c285777e2bb0e2ce1d2378
--- /dev/null
+++ b/device/devices_app/usb/fake_permission_provider.h
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_
+#define DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_
+
+#include "device/devices_app/usb/public/interfaces/permission_provider.mojom.h"
+#include "mojo/common/weak_binding_set.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/array.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
+
+namespace device {
+namespace usb {
+
+class FakePermissionProvider : public PermissionProvider {
+ public:
+ FakePermissionProvider();
+ ~FakePermissionProvider() override;
+
+ void HasDevicePermission(
+ mojo::Array<DeviceInfoPtr> requested_devices,
+ const HasDevicePermissionCallback& callback) override;
+ void HasConfigurationPermission(
+ uint8_t requested_configuration,
+ device::usb::DeviceInfoPtr device,
+ const HasInterfacePermissionCallback& callback) override;
+ void HasInterfacePermission(
+ uint8_t requested_interface,
+ uint8_t configuration_value,
+ device::usb::DeviceInfoPtr device,
+ const HasInterfacePermissionCallback& callback) override;
+ void Bind(mojo::InterfaceRequest<PermissionProvider> request) override;
+
+ private:
+ mojo::WeakBindingSet<PermissionProvider> bindings_;
+};
+
+} // namespace usb
+} // namespace device
+
+#endif // DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698