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

Unified Diff: chrome/browser/usb/web_usb_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: chrome/browser/usb/web_usb_permission_provider.h
diff --git a/chrome/browser/usb/web_usb_permission_provider.h b/chrome/browser/usb/web_usb_permission_provider.h
index e75ead2c1aa2cdca0113fad3c5f99dfce6ec27c2..c29329fe29cbf8f64abcdc708fa0671167bb1dfc 100644
--- a/chrome/browser/usb/web_usb_permission_provider.h
+++ b/chrome/browser/usb/web_usb_permission_provider.h
@@ -6,9 +6,9 @@
#define CHROME_BROWSER_USB_WEB_USB_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"
-#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
namespace content {
class RenderFrameHost;
@@ -30,8 +30,21 @@ class WebUSBPermissionProvider : public device::usb::PermissionProvider {
void HasDevicePermission(
mojo::Array<device::usb::DeviceInfoPtr> requested_devices,
const HasDevicePermissionCallback& callback) override;
-
- mojo::StrongBinding<PermissionProvider> binding_;
+ 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<device::usb::PermissionProvider> request) override;
+
+ void OnConnectionError();
+
+ mojo::WeakBindingSet<PermissionProvider> bindings_;
content::RenderFrameHost* const render_frame_host_;
};

Powered by Google App Engine
This is Rietveld 408576698