| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/common/api/printer_provider/usb_printer_manifest_data.h" | 5 #include "extensions/common/api/printer_provider/usb_printer_manifest_data.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "device/usb/usb_device.h" | 8 #include "device/usb/usb_device.h" |
| 9 #include "device/usb/usb_device_filter.h" | 9 #include "device/usb/usb_device_filter.h" |
| 10 #include "extensions/common/api/extensions_manifest_types.h" | 10 #include "extensions/common/api/extensions_manifest_types.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 result->filters_.push_back(output); | 61 result->filters_.push_back(output); |
| 62 } | 62 } |
| 63 return result; | 63 return result; |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool UsbPrinterManifestData::SupportsDevice( | 66 bool UsbPrinterManifestData::SupportsDevice( |
| 67 const scoped_refptr<device::UsbDevice>& device) const { | 67 const scoped_refptr<device::UsbDevice>& device) const { |
| 68 return UsbDeviceFilter::MatchesAny(device, filters_); | 68 for (const auto& filter : filters_) { |
| 69 if (filter.Matches(device)) |
| 70 return true; |
| 71 } |
| 72 |
| 73 return false; |
| 69 } | 74 } |
| 70 | 75 |
| 71 } // namespace extensions | 76 } // namespace extensions |
| OLD | NEW |