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

Side by Side Diff: android_webview/renderer/print_web_view_helper_linux.cc

Issue 568633002: Extracted MetafilePlayer interface from printing::MetafilePlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_expose
Patch Set: Thu Sep 11 22:54:16 PDT 2014 Created 6 years, 3 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 | « no previous file | chrome/browser/printing/pdf_to_emf_converter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // TODO(sgurun) copied from chrome/renderer. Remove after crbug.com/322276 5 // TODO(sgurun) copied from chrome/renderer. Remove after crbug.com/322276
6 6
7 #include "android_webview/renderer/print_web_view_helper.h" 7 #include "android_webview/renderer/print_web_view_helper.h"
8 8
9 #include "android_webview/common/print_messages.h" 9 #include "android_webview/common/print_messages.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 print_preview_context_.GetPrintCanvasSize(), 45 print_preview_context_.GetPrintCanvasSize(),
46 print_preview_context_.prepared_frame(), 46 print_preview_context_.prepared_frame(),
47 initial_render_metafile); 47 initial_render_metafile);
48 print_preview_context_.RenderedPreviewPage( 48 print_preview_context_.RenderedPreviewPage(
49 base::TimeTicks::Now() - begin_time); 49 base::TimeTicks::Now() - begin_time);
50 if (draft_metafile.get()) { 50 if (draft_metafile.get()) {
51 draft_metafile->FinishDocument(); 51 draft_metafile->FinishDocument();
52 } else if (print_preview_context_.IsModifiable() && 52 } else if (print_preview_context_.IsModifiable() &&
53 print_preview_context_.generate_draft_pages()) { 53 print_preview_context_.generate_draft_pages()) {
54 DCHECK(!draft_metafile.get()); 54 DCHECK(!draft_metafile.get());
55 draft_metafile.reset( 55 draft_metafile =
56 print_preview_context_.metafile()->GetMetafileForCurrentPage()); 56 print_preview_context_.metafile()->GetMetafileForCurrentPage();
57 } 57 }
58 return PreviewPageRendered(page_number, draft_metafile.get()); 58 return PreviewPageRendered(page_number, draft_metafile.get());
59 } 59 }
60 60
61 bool PrintWebViewHelper::PrintPagesNative(blink::WebFrame* frame, 61 bool PrintWebViewHelper::PrintPagesNative(blink::WebFrame* frame,
62 int page_count, 62 int page_count,
63 const gfx::Size& canvas_size) { 63 const gfx::Size& canvas_size) {
64 PdfMetafileSkia metafile; 64 PdfMetafileSkia metafile;
65 if (!metafile.Init()) 65 if (!metafile.Init())
66 return false; 66 return false;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 RenderPageContent(frame, params.page_number, canvas_area, content_area, 191 RenderPageContent(frame, params.page_number, canvas_area, content_area,
192 scale_factor, canvas.get()); 192 scale_factor, canvas.get());
193 193
194 // Done printing. Close the device context to retrieve the compiled metafile. 194 // Done printing. Close the device context to retrieve the compiled metafile.
195 if (!metafile->FinishPage()) 195 if (!metafile->FinishPage())
196 NOTREACHED() << "metafile failed"; 196 NOTREACHED() << "metafile failed";
197 } 197 }
198 198
199 } // namespace printing 199 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/pdf_to_emf_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698