Chromium Code Reviews| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 // IPC. Make sure recursive task processing is disabled. | 291 // IPC. Make sure recursive task processing is disabled. |
| 292 if (StartDoc(context_, &di) <= 0) | 292 if (StartDoc(context_, &di) <= 0) |
| 293 return OnError(); | 293 return OnError(); |
| 294 | 294 |
| 295 return OK; | 295 return OK; |
| 296 } | 296 } |
| 297 | 297 |
| 298 PrintingContext::Result PrintingContextWin::NewPage() { | 298 PrintingContext::Result PrintingContextWin::NewPage() { |
| 299 if (abort_printing_) | 299 if (abort_printing_) |
| 300 return CANCEL; | 300 return CANCEL; |
| 301 | |
| 302 DCHECK(context_); | 301 DCHECK(context_); |
| 303 DCHECK(in_print_job_); | 302 DCHECK(in_print_job_); |
| 304 | 303 |
| 305 // Inform the driver that the application is about to begin sending data. | 304 // Intentional No-op. |
|
vandebo (ex-Chrome)
2011/03/15 20:41:39
Hmm, maybe we should note that NativeMetafile::Saf
dpapad
2011/03/15 20:56:44
Done.
| |
| 306 if (StartPage(context_) <= 0) | |
| 307 return OnError(); | |
| 308 | 305 |
| 309 return OK; | 306 return OK; |
| 310 } | 307 } |
| 311 | 308 |
| 312 PrintingContext::Result PrintingContextWin::PageDone() { | 309 PrintingContext::Result PrintingContextWin::PageDone() { |
| 313 if (abort_printing_) | 310 if (abort_printing_) |
| 314 return CANCEL; | 311 return CANCEL; |
| 315 DCHECK(in_print_job_); | 312 DCHECK(in_print_job_); |
| 316 | 313 |
| 317 if (EndPage(context_) <= 0) | 314 // Intentional No-op. |
| 318 return OnError(); | 315 |
| 319 return OK; | 316 return OK; |
| 320 } | 317 } |
| 321 | 318 |
| 322 PrintingContext::Result PrintingContextWin::DocumentDone() { | 319 PrintingContext::Result PrintingContextWin::DocumentDone() { |
| 323 if (abort_printing_) | 320 if (abort_printing_) |
| 324 return CANCEL; | 321 return CANCEL; |
| 325 DCHECK(in_print_job_); | 322 DCHECK(in_print_job_); |
| 326 DCHECK(context_); | 323 DCHECK(context_); |
| 327 | 324 |
| 328 // Inform the driver that document has ended. | 325 // Inform the driver that document has ended. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 611 if (buf_size) { | 608 if (buf_size) { |
| 612 buffer->reset(new uint8[buf_size]); | 609 buffer->reset(new uint8[buf_size]); |
| 613 memset(buffer->get(), 0, buf_size); | 610 memset(buffer->get(), 0, buf_size); |
| 614 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { | 611 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { |
| 615 buffer->reset(); | 612 buffer->reset(); |
| 616 } | 613 } |
| 617 } | 614 } |
| 618 } | 615 } |
| 619 | 616 |
| 620 } // namespace printing | 617 } // namespace printing |
| OLD | NEW |