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

Unified Diff: components/usb_service/usb_device_filter.h

Issue 517923002: Add more generic filters to the chrome.usb.getDevices API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Function comments are descriptive. Created 6 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
« no previous file with comments | « no previous file | components/usb_service/usb_device_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/usb_service/usb_device_filter.h
diff --git a/components/usb_service/usb_device_filter.h b/components/usb_service/usb_device_filter.h
index 76a3b2c73967f6bf2672e610988bdd7298d7e021..26911523c7c2c3223ab47474d50656e49647bfab 100644
--- a/components/usb_service/usb_device_filter.h
+++ b/components/usb_service/usb_device_filter.h
@@ -5,6 +5,8 @@
#ifndef COMPONENTS_USB_SERVICE_USB_DEVICE_FILTER_H_
#define COMPONENTS_USB_SERVICE_USB_DEVICE_FILTER_H_
+#include <vector>
+
#include "base/memory/ref_counted.h"
#include "components/usb_service/usb_service_export.h"
@@ -27,9 +29,12 @@ class USB_SERVICE_EXPORT UsbDeviceFilter {
void SetInterfaceSubclass(uint8 interface_subclass);
void SetInterfaceProtocol(uint8 interface_protocol);
- bool Matches(scoped_refptr<UsbDevice> device);
+ bool Matches(scoped_refptr<UsbDevice> device) const;
base::Value* ToValue() const;
+ static bool MatchesAny(scoped_refptr<UsbDevice> device,
+ const std::vector<UsbDeviceFilter>& filters);
+
private:
uint16 vendor_id_;
uint16 product_id_;
« no previous file with comments | « no previous file | components/usb_service/usb_device_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698