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

Side by Side Diff: printing/printed_document_win.cc

Issue 10483006: Print support for Windows Metro... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Working version Created 8 years, 6 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
« printing/printed_document.cc ('K') | « printing/printed_document.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/printed_document.h" 5 #include "printing/printed_document.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "printing/page_number.h" 8 #include "printing/page_number.h"
9 #include "printing/printed_pages_source.h" 9 #include "printing/printed_pages_source.h"
10 #include "printing/printed_page.h" 10 #include "printing/printed_page.h"
(...skipping 24 matching lines...) Expand all
35 35
36 void PrintedDocument::RenderPrintedPage( 36 void PrintedDocument::RenderPrintedPage(
37 const PrintedPage& page, gfx::NativeDrawingContext context) const { 37 const PrintedPage& page, gfx::NativeDrawingContext context) const {
38 #ifndef NDEBUG 38 #ifndef NDEBUG
39 { 39 {
40 // Make sure the page is from our list. 40 // Make sure the page is from our list.
41 base::AutoLock lock(lock_); 41 base::AutoLock lock(lock_);
42 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get()); 42 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get());
43 } 43 }
44 #endif 44 #endif
45 if (immutable_.delegate_) {
46 std::vector<uint8> metabytes(page.metafile()->GetDataSize());
47 bool success = page.metafile()->GetData(
48 reinterpret_cast<void*>(&metabytes[0]), metabytes.size());
49 immutable_.delegate_->SetPageContent(
50 page.page_number(),
51 reinterpret_cast<void*>(&metabytes[0]),
52 metabytes.size());
53 return;
54 }
45 55
46 DCHECK(context); 56 DCHECK(context);
47 57
48 const PageSetup& page_setup(immutable_.settings_.page_setup_device_units()); 58 const PageSetup& page_setup(immutable_.settings_.page_setup_device_units());
49 gfx::Rect content_area; 59 gfx::Rect content_area;
50 page.GetCenteredPageContentRect(page_setup.physical_size(), &content_area); 60 page.GetCenteredPageContentRect(page_setup.physical_size(), &content_area);
51 61
52 // Save the state to make sure the context this function call does not modify 62 // Save the state to make sure the context this function call does not modify
53 // the device context. 63 // the device context.
54 int saved_state = SaveDC(context); 64 int saved_state = SaveDC(context);
(...skipping 20 matching lines...) Expand all
75 85
76 BOOL res = RestoreDC(context, saved_state); 86 BOOL res = RestoreDC(context, saved_state);
77 DCHECK_NE(res, 0); 87 DCHECK_NE(res, 0);
78 } 88 }
79 89
80 int res = RestoreDC(context, saved_state); 90 int res = RestoreDC(context, saved_state);
81 DCHECK_NE(res, 0); 91 DCHECK_NE(res, 0);
82 } 92 }
83 93
84 } // namespace printing 94 } // namespace printing
OLDNEW
« printing/printed_document.cc ('K') | « printing/printed_document.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698