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 "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 Loading... |
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 } |
OLD | NEW |