| Index: components/usb_service/usb_device_filter.cc
|
| diff --git a/components/usb_service/usb_device_filter.cc b/components/usb_service/usb_device_filter.cc
|
| index 45f8d12d1f9d48d81a9d3ab9d0c6a3e82d015e13..d026fa054d30fbb016653e87e8749eb071c5a301 100644
|
| --- a/components/usb_service/usb_device_filter.cc
|
| +++ b/components/usb_service/usb_device_filter.cc
|
| @@ -6,7 +6,6 @@
|
|
|
| #include "base/values.h"
|
| #include "components/usb_service/usb_device.h"
|
| -#include "components/usb_service/usb_device_handle.h"
|
| #include "components/usb_service/usb_interface.h"
|
|
|
| namespace usb_service {
|
| @@ -57,7 +56,7 @@ void UsbDeviceFilter::SetInterfaceProtocol(uint8 interface_protocol) {
|
| interface_protocol_ = interface_protocol;
|
| }
|
|
|
| -bool UsbDeviceFilter::Matches(scoped_refptr<UsbDevice> device) {
|
| +bool UsbDeviceFilter::Matches(scoped_refptr<UsbDevice> device) const {
|
| if (vendor_id_set_) {
|
| if (device->vendor_id() != vendor_id_) {
|
| return false;
|
| @@ -125,4 +124,17 @@ base::Value* UsbDeviceFilter::ToValue() const {
|
| return obj.release();
|
| }
|
|
|
| +// static
|
| +bool UsbDeviceFilter::MatchesAny(scoped_refptr<UsbDevice> device,
|
| + const std::vector<UsbDeviceFilter>& filters) {
|
| + for (std::vector<UsbDeviceFilter>::const_iterator i = filters.begin();
|
| + i != filters.end();
|
| + ++i) {
|
| + if (i->Matches(device)) {
|
| + return true;
|
| + }
|
| + }
|
| + return false;
|
| +}
|
| +
|
| } // namespace usb_service
|
|
|