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

Side by Side Diff: printing/printing_context_win.cc

Issue 6673035: Move Start/EndPage() from NewPage/PageDone() to inside the metafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows fix after rebasing Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/print_web_view_helper_win.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) 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
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. NativeMetafile::SafePlayback takes care of calling
306 if (StartPage(context_) <= 0) 305 // ::StartPage().
307 return OnError();
308 306
309 return OK; 307 return OK;
310 } 308 }
311 309
312 PrintingContext::Result PrintingContextWin::PageDone() { 310 PrintingContext::Result PrintingContextWin::PageDone() {
313 if (abort_printing_) 311 if (abort_printing_)
314 return CANCEL; 312 return CANCEL;
315 DCHECK(in_print_job_); 313 DCHECK(in_print_job_);
316 314
317 if (EndPage(context_) <= 0) 315 // Intentional No-op. NativeMetafile::SafePlayback takes care of calling
318 return OnError(); 316 // ::EndPage().
317
319 return OK; 318 return OK;
320 } 319 }
321 320
322 PrintingContext::Result PrintingContextWin::DocumentDone() { 321 PrintingContext::Result PrintingContextWin::DocumentDone() {
323 if (abort_printing_) 322 if (abort_printing_)
324 return CANCEL; 323 return CANCEL;
325 DCHECK(in_print_job_); 324 DCHECK(in_print_job_);
326 DCHECK(context_); 325 DCHECK(context_);
327 326
328 // Inform the driver that document has ended. 327 // Inform the driver that document has ended.
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 if (buf_size) { 610 if (buf_size) {
612 buffer->reset(new uint8[buf_size]); 611 buffer->reset(new uint8[buf_size]);
613 memset(buffer->get(), 0, buf_size); 612 memset(buffer->get(), 0, buf_size);
614 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { 613 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) {
615 buffer->reset(); 614 buffer->reset();
616 } 615 }
617 } 616 }
618 } 617 }
619 618
620 } // namespace printing 619 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/renderer/print_web_view_helper_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698