OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_helper.h" | 5 #include "printing/backend/cups_helper.h" |
6 | 6 |
7 #include <cups/ppd.h> | 7 #include <cups/ppd.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 const char kColorMode[] = "ColorMode"; | 29 const char kColorMode[] = "ColorMode"; |
30 const char kProcessColorModel[] = "ProcessColorModel"; | 30 const char kProcessColorModel[] = "ProcessColorModel"; |
31 const char kPrintoutMode[] = "PrintoutMode"; | 31 const char kPrintoutMode[] = "PrintoutMode"; |
32 const char kDraftGray[] = "Draft.Gray"; | 32 const char kDraftGray[] = "Draft.Gray"; |
33 const char kHighGray[] = "High.Gray"; | 33 const char kHighGray[] = "High.Gray"; |
34 | 34 |
35 const char kDuplex[] = "Duplex"; | 35 const char kDuplex[] = "Duplex"; |
36 const char kDuplexNone[] = "None"; | 36 const char kDuplexNone[] = "None"; |
37 const char kPageSize[] = "PageSize"; | 37 const char kPageSize[] = "PageSize"; |
38 | 38 |
39 const double kMicronsPerPoint = kHundrethsMMPerInch / kPointsPerInch * 10; | 39 const double kMicronsPerPoint = 10.0f * kHundrethsMMPerInch / kPointsPerInch; |
40 | 40 |
41 #if !defined(OS_MACOSX) | 41 #if !defined(OS_MACOSX) |
42 void ParseLpOptions(const base::FilePath& filepath, | 42 void ParseLpOptions(const base::FilePath& filepath, |
43 const std::string& printer_name, | 43 const std::string& printer_name, |
44 int* num_options, cups_option_t** options) { | 44 int* num_options, cups_option_t** options) { |
45 std::string content; | 45 std::string content; |
46 if (!base::ReadFileToString(filepath, &content)) | 46 if (!base::ReadFileToString(filepath, &content)) |
47 return; | 47 return; |
48 | 48 |
49 const char kDest[] = "dest"; | 49 const char kDest[] = "dest"; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 435 } |
436 | 436 |
437 ppdClose(ppd); | 437 ppdClose(ppd); |
438 base::DeleteFile(ppd_file_path, false); | 438 base::DeleteFile(ppd_file_path, false); |
439 | 439 |
440 *printer_info = caps; | 440 *printer_info = caps; |
441 return true; | 441 return true; |
442 } | 442 } |
443 | 443 |
444 } // namespace printing | 444 } // namespace printing |
OLD | NEW |