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

Unified Diff: extensions/common/api/printer_provider/usb_printer_manifest_data.cc

Issue 2266153002: Modify UsbDeviceFilter::MatchesAny to return true for empty filters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed code for unit test Created 4 years, 4 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 | « extensions/browser/api/usb/usb_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/api/printer_provider/usb_printer_manifest_data.cc
diff --git a/extensions/common/api/printer_provider/usb_printer_manifest_data.cc b/extensions/common/api/printer_provider/usb_printer_manifest_data.cc
index e7e7acce17030199ae694bf8016cc2ff15ffcf14..35f21651da86f12cb7f2ae314d90bba424c60b62 100644
--- a/extensions/common/api/printer_provider/usb_printer_manifest_data.cc
+++ b/extensions/common/api/printer_provider/usb_printer_manifest_data.cc
@@ -65,7 +65,12 @@ std::unique_ptr<UsbPrinterManifestData> UsbPrinterManifestData::FromValue(
bool UsbPrinterManifestData::SupportsDevice(
const scoped_refptr<device::UsbDevice>& device) const {
- return UsbDeviceFilter::MatchesAny(device, filters_);
+ for (const auto& filter : filters_) {
+ if (filter.Matches(device))
+ return true;
+ }
+
+ return false;
}
} // namespace extensions
« no previous file with comments | « extensions/browser/api/usb/usb_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698