Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: printing/printing_context_win.cc

Issue 3418034: Printing: Push checking of |context| one level lower, as the different (Closed)
Patch Set: One more. Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/printing/print_job_worker.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job_worker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698