OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/service/cloud_print/cdd_conversion_win.h" | 5 #include "chrome/service/cloud_print/cdd_conversion_win.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "components/cloud_devices/common/printer_description.h" | 8 #include "components/cloud_devices/common/printer_description.h" |
9 #include "printing/backend/win_helper.h" | 9 #include "printing/backend/win_helper.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 using namespace cloud_devices::printer; | 27 using namespace cloud_devices::printer; |
28 printing::ScopedPrinterHandle printer; | 28 printing::ScopedPrinterHandle printer; |
29 if (!printer.OpenPrinter(printer_name.c_str())) | 29 if (!printer.OpenPrinter(printer_name.c_str())) |
30 return dev_mode.Pass(); | 30 return dev_mode.Pass(); |
31 | 31 |
32 { | 32 { |
33 ColorTicketItem color; | 33 ColorTicketItem color; |
34 if (color.LoadFrom(description)) { | 34 if (color.LoadFrom(description)) { |
35 bool is_color = color.value().type == STANDARD_COLOR; | 35 bool is_color = color.value().type == STANDARD_COLOR; |
36 dev_mode = CreateDevModeWithColor(printer, printer_name, is_color); | 36 dev_mode = printing::CreateDevModeWithColor(printer.Get(), printer_name, |
| 37 is_color); |
37 } else { | 38 } else { |
38 dev_mode = printing::CreateDevMode(printer, NULL); | 39 dev_mode = printing::CreateDevMode(printer.Get(), NULL); |
39 } | 40 } |
40 } | 41 } |
41 | 42 |
42 if (!dev_mode) | 43 if (!dev_mode) |
43 return dev_mode.Pass(); | 44 return dev_mode.Pass(); |
44 | 45 |
45 ColorTicketItem color; | 46 ColorTicketItem color; |
46 DuplexTicketItem duplex; | 47 DuplexTicketItem duplex; |
47 OrientationTicketItem orientation; | 48 OrientationTicketItem orientation; |
48 MarginsTicketItem margins; | 49 MarginsTicketItem margins; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 dev_mode->dmFields |= DM_PAPERSIZE; | 118 dev_mode->dmFields |= DM_PAPERSIZE; |
118 dev_mode->dmPaperSize = static_cast<short>(id); | 119 dev_mode->dmPaperSize = static_cast<short>(id); |
119 } else if (width > 0 && height > 0) { | 120 } else if (width > 0 && height > 0) { |
120 dev_mode->dmFields |= DM_PAPERWIDTH; | 121 dev_mode->dmFields |= DM_PAPERWIDTH; |
121 dev_mode->dmPaperWidth = width; | 122 dev_mode->dmPaperWidth = width; |
122 dev_mode->dmFields |= DM_PAPERLENGTH; | 123 dev_mode->dmFields |= DM_PAPERLENGTH; |
123 dev_mode->dmPaperLength = height; | 124 dev_mode->dmPaperLength = height; |
124 } | 125 } |
125 } | 126 } |
126 | 127 |
127 return printing::CreateDevMode(printer, dev_mode.get()); | 128 return printing::CreateDevMode(printer.Get(), dev_mode.get()); |
128 } | 129 } |
129 | 130 |
130 } // namespace cloud_print | 131 } // namespace cloud_print |
OLD | NEW |