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 "extensions/common/api/printer_provider/usb_printer_manifest_data.h" | 5 #include "extensions/common/api/printer_provider/usb_printer_manifest_data.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
9 #include "device/usb/usb_device.h" | 11 #include "device/usb/usb_device.h" |
10 #include "device/usb/usb_device_filter.h" | 12 #include "device/usb/usb_device_filter.h" |
11 #include "extensions/common/api/extensions_manifest_types.h" | 13 #include "extensions/common/api/extensions_manifest_types.h" |
12 #include "extensions/common/manifest_constants.h" | 14 #include "extensions/common/manifest_constants.h" |
13 | 15 |
14 using device::UsbDeviceFilter; | 16 using device::UsbDeviceFilter; |
15 | 17 |
16 namespace extensions { | 18 namespace extensions { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 64 } |
63 | 65 |
64 result->filters_.push_back(output); | 66 result->filters_.push_back(output); |
65 } | 67 } |
66 return result; | 68 return result; |
67 } | 69 } |
68 | 70 |
69 bool UsbPrinterManifestData::SupportsDevice( | 71 bool UsbPrinterManifestData::SupportsDevice( |
70 const scoped_refptr<device::UsbDevice>& device) const { | 72 const scoped_refptr<device::UsbDevice>& device) const { |
71 for (const auto& filter : filters_) { | 73 for (const auto& filter : filters_) { |
72 if (filter.Matches(device)) | 74 if (filter.Matches(*device)) |
73 return true; | 75 return true; |
74 } | 76 } |
75 | 77 |
76 return false; | 78 return false; |
77 } | 79 } |
78 | 80 |
79 } // namespace extensions | 81 } // namespace extensions |
OLD | NEW |