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

Side by Side Diff: printing/backend/cups_ipp_util.cc

Issue 2232813002: printing: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "printing/backend/cups_ipp_util.h" 5 #include "printing/backend/cups_ipp_util.h"
6 6
7 #include <cups/cups.h> 7 #include <cups/cups.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 return UNKNOWN_COLOR_MODEL; 64 return UNKNOWN_COLOR_MODEL;
65 } 65 }
66 66
67 bool PrinterSupportsValue(const CupsOptionProvider& printer, 67 bool PrinterSupportsValue(const CupsOptionProvider& printer,
68 base::StringPiece name, 68 base::StringPiece name,
69 base::StringPiece value) { 69 base::StringPiece value) {
70 std::vector<base::StringPiece> values = 70 std::vector<base::StringPiece> values =
71 printer.GetSupportedOptionValueStrings(name); 71 printer.GetSupportedOptionValueStrings(name);
72 return ContainsValue(values, value); 72 return base::ContainsValue(values, value);
73 } 73 }
74 74
75 DuplexMode PrinterDefaultDuplex(const CupsOptionProvider& printer) { 75 DuplexMode PrinterDefaultDuplex(const CupsOptionProvider& printer) {
76 ipp_attribute_t* attr = printer.GetDefaultOptionValue(kIppDuplex); 76 ipp_attribute_t* attr = printer.GetDefaultOptionValue(kIppDuplex);
77 if (!attr) 77 if (!attr)
78 return UNKNOWN_DUPLEX_MODE; 78 return UNKNOWN_DUPLEX_MODE;
79 79
80 const char* value = ippGetString(attr, 0, nullptr); 80 const char* value = ippGetString(attr, 0, nullptr);
81 if (base::EqualsCaseInsensitiveASCII(value, CUPS_SIDES_ONE_SIDED)) 81 if (base::EqualsCaseInsensitiveASCII(value, CUPS_SIDES_ONE_SIDED))
82 return SIMPLEX; 82 return SIMPLEX;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 printer_info->default_paper = DefaultPaper(printer); 292 printer_info->default_paper = DefaultPaper(printer);
293 printer_info->papers = SupportedPapers(printer); 293 printer_info->papers = SupportedPapers(printer);
294 294
295 ExtractCopies(printer, printer_info); 295 ExtractCopies(printer, printer_info);
296 ExtractColor(printer, printer_info); 296 ExtractColor(printer, printer_info);
297 297
298 // TODO(skau): Add dpi and default_dpi 298 // TODO(skau): Add dpi and default_dpi
299 } 299 }
300 300
301 } // namespace printing 301 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698