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

Unified Diff: extensions/browser/api/usb/usb_api.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
Index: extensions/browser/api/usb/usb_api.cc
diff --git a/extensions/browser/api/usb/usb_api.cc b/extensions/browser/api/usb/usb_api.cc
index 62e4c5adcdf8056d023eb7d87a8fcf5a94fa6faf..2ece8932ad2ed78f1a9314df2afc651a6c3677d9 100644
--- a/extensions/browser/api/usb/usb_api.cc
+++ b/extensions/browser/api/usb/usb_api.cc
@@ -595,7 +595,7 @@ void UsbGetDevicesFunction::OnGetDevicesComplete(
std::unique_ptr<base::ListValue> result(new base::ListValue());
UsbGuidMap* guid_map = UsbGuidMap::Get(browser_context());
for (const scoped_refptr<UsbDevice>& device : devices) {
- if ((filters_.empty() || UsbDeviceFilter::MatchesAny(device, filters_)) &&
+ if (UsbDeviceFilter::MatchesAny(device, filters_) &&
HasDevicePermission(device)) {
Device api_device;
guid_map->GetApiDevice(device, &api_device);

Powered by Google App Engine
This is Rietveld 408576698