OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.h" | 5 #include "printing/printing_context.h" |
6 | 6 |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/i18n/file_util_icu.h" | 10 #include "base/i18n/file_util_icu.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 if (EndPage(context_) <= 0) | 324 if (EndPage(context_) <= 0) |
325 return OnError(); | 325 return OnError(); |
326 return OK; | 326 return OK; |
327 } | 327 } |
328 | 328 |
329 PrintingContext::Result PrintingContext::DocumentDone() { | 329 PrintingContext::Result PrintingContext::DocumentDone() { |
330 if (abort_printing_) | 330 if (abort_printing_) |
331 return CANCEL; | 331 return CANCEL; |
332 DCHECK(in_print_job_); | 332 DCHECK(in_print_job_); |
| 333 DCHECK(context_); |
333 | 334 |
334 // Inform the driver that document has ended. | 335 // Inform the driver that document has ended. |
335 if (EndDoc(context_) <= 0) | 336 if (EndDoc(context_) <= 0) |
336 return OnError(); | 337 return OnError(); |
337 | 338 |
338 ResetSettings(); | 339 ResetSettings(); |
339 return OK; | 340 return OK; |
340 } | 341 } |
341 | 342 |
342 void PrintingContext::Cancel() { | 343 void PrintingContext::Cancel() { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 if (buf_size) { | 614 if (buf_size) { |
614 buffer->reset(new uint8[buf_size]); | 615 buffer->reset(new uint8[buf_size]); |
615 memset(buffer->get(), 0, buf_size); | 616 memset(buffer->get(), 0, buf_size); |
616 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { | 617 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { |
617 buffer->reset(); | 618 buffer->reset(); |
618 } | 619 } |
619 } | 620 } |
620 } | 621 } |
621 | 622 |
622 } // namespace printing | 623 } // namespace printing |
OLD | NEW |