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

Side by Side Diff: extensions/common/api/printer_provider/usb_printer_manifest_data.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, 9 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
« no previous file with comments | « extensions/browser/api/usb/usb_api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
OLDNEW
« 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