| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/usb/usb_device_filter.h" | 5 #include "device/usb/usb_device_filter.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 return std::move(obj); | 114 return std::move(obj); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // static | 117 // static |
| 118 bool UsbDeviceFilter::MatchesAny(scoped_refptr<UsbDevice> device, | 118 bool UsbDeviceFilter::MatchesAny(scoped_refptr<UsbDevice> device, |
| 119 const std::vector<UsbDeviceFilter>& filters) { | 119 const std::vector<UsbDeviceFilter>& filters) { |
| 120 if (filters.empty()) |
| 121 return true; |
| 122 |
| 120 for (std::vector<UsbDeviceFilter>::const_iterator i = filters.begin(); | 123 for (std::vector<UsbDeviceFilter>::const_iterator i = filters.begin(); |
| 121 i != filters.end(); | 124 i != filters.end(); |
| 122 ++i) { | 125 ++i) { |
| 123 if (i->Matches(device)) { | 126 if (i->Matches(device)) { |
| 124 return true; | 127 return true; |
| 125 } | 128 } |
| 126 } | 129 } |
| 127 return false; | 130 return false; |
| 128 } | 131 } |
| 129 | 132 |
| 130 } // namespace device | 133 } // namespace device |
| OLD | NEW |