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

Side by Side Diff: chrome/browser/usb/usb_chooser_controller.cc

Issue 2727633004: Change UsbDeviceFilter to use const references instead of (Closed)
Patch Set: Fix callsite missed earlier due to not building for CrOS Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/usb/usb_chooser_controller.h" 5 #include "chrome/browser/usb/usb_chooser_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 devices_.push_back(std::make_pair(device, device_name)); 221 devices_.push_back(std::make_pair(device, device_name));
222 ++device_name_map_[device_name]; 222 ++device_name_map_[device_name];
223 } 223 }
224 } 224 }
225 if (view()) 225 if (view())
226 view()->OnOptionsInitialized(); 226 view()->OnOptionsInitialized();
227 } 227 }
228 228
229 bool UsbChooserController::DisplayDevice( 229 bool UsbChooserController::DisplayDevice(
230 scoped_refptr<UsbDevice> device) const { 230 scoped_refptr<UsbDevice> device) const {
231 if (!UsbDeviceFilter::MatchesAny(device, filters_)) 231 if (!UsbDeviceFilter::MatchesAny(*device, filters_))
232 return false; 232 return false;
233 233
234 if (UsbBlocklist::Get().IsExcluded(device)) 234 if (UsbBlocklist::Get().IsExcluded(device))
235 return false; 235 return false;
236 236
237 // Embedded frames must have their origin in the list provided by the device. 237 // Embedded frames must have their origin in the list provided by the device.
238 if (is_embedded_frame_) { 238 if (is_embedded_frame_) {
239 return device::FindInWebUsbAllowedOrigins(device->webusb_allowed_origins(), 239 return device::FindInWebUsbAllowedOrigins(device->webusb_allowed_origins(),
240 requesting_origin_, base::nullopt, 240 requesting_origin_, base::nullopt,
241 base::nullopt); 241 base::nullopt);
242 } 242 }
243 243
244 return true; 244 return true;
245 } 245 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/usb_chooser_dialog_android.cc ('k') | device/usb/mojo/device_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698