| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/printing_context_win.h" | 5 #include "printing/printing_context_win.h" |
| 6 | 6 |
| 7 #include <winspool.h> | 7 #include <winspool.h> |
| 8 | 8 |
| 9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 PRINTDLG dialog_options = { sizeof(PRINTDLG) }; | 202 PRINTDLG dialog_options = { sizeof(PRINTDLG) }; |
| 203 dialog_options.Flags = PD_RETURNDC | PD_RETURNDEFAULT; | 203 dialog_options.Flags = PD_RETURNDC | PD_RETURNDEFAULT; |
| 204 if (PrintDlg(&dialog_options) == 0) { | 204 if (PrintDlg(&dialog_options) == 0) { |
| 205 ResetSettings(); | 205 ResetSettings(); |
| 206 return FAILED; | 206 return FAILED; |
| 207 } | 207 } |
| 208 return ParseDialogResult(dialog_options); | 208 return ParseDialogResult(dialog_options); |
| 209 } | 209 } |
| 210 | 210 |
| 211 PrintingContext::Result PrintingContextWin::UpdatePrintSettings( |
| 212 const PageRanges& ranges) { |
| 213 DCHECK(!in_print_job_); |
| 214 |
| 215 settings_.ranges = ranges; |
| 216 |
| 217 NOTIMPLEMENTED(); |
| 218 |
| 219 return FAILED; |
| 220 } |
| 221 |
| 211 PrintingContext::Result PrintingContextWin::InitWithSettings( | 222 PrintingContext::Result PrintingContextWin::InitWithSettings( |
| 212 const PrintSettings& settings) { | 223 const PrintSettings& settings) { |
| 213 DCHECK(!in_print_job_); | 224 DCHECK(!in_print_job_); |
| 214 | 225 |
| 215 settings_ = settings; | 226 settings_ = settings; |
| 216 | 227 |
| 217 // TODO(maruel): settings_.ToDEVMODE() | 228 // TODO(maruel): settings_.ToDEVMODE() |
| 218 HANDLE printer; | 229 HANDLE printer; |
| 219 if (!OpenPrinter(const_cast<wchar_t*>(settings_.device_name().c_str()), | 230 if (!OpenPrinter(const_cast<wchar_t*>(settings_.device_name().c_str()), |
| 220 &printer, | 231 &printer, |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 if (buf_size) { | 611 if (buf_size) { |
| 601 buffer->reset(new uint8[buf_size]); | 612 buffer->reset(new uint8[buf_size]); |
| 602 memset(buffer->get(), 0, buf_size); | 613 memset(buffer->get(), 0, buf_size); |
| 603 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { | 614 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { |
| 604 buffer->reset(); | 615 buffer->reset(); |
| 605 } | 616 } |
| 606 } | 617 } |
| 607 } | 618 } |
| 608 | 619 |
| 609 } // namespace printing | 620 } // namespace printing |
| OLD | NEW |