| OLD | NEW |
| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
| 17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "printing/backend/cups_printer.h" | 19 #include "printing/backend/cups_printer.h" |
| 20 #include "printing/backend/print_backend_consts.h" | 20 #include "printing/backend/print_backend_consts.h" |
| 21 #include "printing/units.h" | 21 #include "printing/units.h" |
| 22 | 22 |
| 23 namespace printing { | 23 namespace printing { |
| 24 | 24 |
| 25 namespace { | 25 // property names |
| 26 | |
| 27 const char kIppCollate[] = "sheet-collate"; // RFC 3381 | 26 const char kIppCollate[] = "sheet-collate"; // RFC 3381 |
| 28 const char kIppCopies[] = CUPS_COPIES; | 27 const char kIppCopies[] = CUPS_COPIES; |
| 29 const char kIppColor[] = CUPS_PRINT_COLOR_MODE; | 28 const char kIppColor[] = CUPS_PRINT_COLOR_MODE; |
| 30 const char kIppMedia[] = CUPS_MEDIA; | 29 const char kIppMedia[] = CUPS_MEDIA; |
| 31 const char kIppDuplex[] = CUPS_SIDES; | 30 const char kIppDuplex[] = CUPS_SIDES; |
| 32 | 31 |
| 32 // collation values |
| 33 const char kCollated[] = "collated"; | 33 const char kCollated[] = "collated"; |
| 34 const char kUncollated[] = "uncollated"; |
| 35 |
| 36 namespace { |
| 34 | 37 |
| 35 const int kMicronsPerMM = 1000; | 38 const int kMicronsPerMM = 1000; |
| 36 const double kMMPerInch = 25.4; | 39 const double kMMPerInch = 25.4; |
| 37 const double kMicronsPerInch = kMMPerInch * kMicronsPerMM; | 40 const double kMicronsPerInch = kMMPerInch * kMicronsPerMM; |
| 38 | 41 |
| 39 enum Unit { | 42 enum Unit { |
| 40 INCHES, | 43 INCHES, |
| 41 MILLIMETERS, | 44 MILLIMETERS, |
| 42 }; | 45 }; |
| 43 | 46 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 printer_info->default_paper = DefaultPaper(printer); | 292 printer_info->default_paper = DefaultPaper(printer); |
| 290 printer_info->papers = SupportedPapers(printer); | 293 printer_info->papers = SupportedPapers(printer); |
| 291 | 294 |
| 292 ExtractCopies(printer, printer_info); | 295 ExtractCopies(printer, printer_info); |
| 293 ExtractColor(printer, printer_info); | 296 ExtractColor(printer, printer_info); |
| 294 | 297 |
| 295 // TODO(skau): Add dpi and default_dpi | 298 // TODO(skau): Add dpi and default_dpi |
| 296 } | 299 } |
| 297 | 300 |
| 298 } // namespace printing | 301 } // namespace printing |
| OLD | NEW |