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

Side by Side Diff: chrome/renderer/print_web_view_helper.cc

Issue 7582014: Remove metafile casts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 4 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.h ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('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 (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 "chrome/renderer/print_web_view_helper.h" 5 #include "chrome/renderer/print_web_view_helper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 391
392 void PrintWebViewHelper::OnAbortPreview() { 392 void PrintWebViewHelper::OnAbortPreview() {
393 DidFinishPrinting(ABORT_PREVIEW); 393 DidFinishPrinting(ABORT_PREVIEW);
394 return; 394 return;
395 } 395 }
396 396
397 bool PrintWebViewHelper::FinalizePreviewDocument() { 397 bool PrintWebViewHelper::FinalizePreviewDocument() {
398 print_preview_context_.FinalizePreviewDocument(); 398 print_preview_context_.FinalizePreviewDocument();
399 399
400 // Get the size of the resulting metafile. 400 // Get the size of the resulting metafile.
401 printing::Metafile* metafile = print_preview_context_.metafile(); 401 printing::PreviewMetafile* metafile = print_preview_context_.metafile();
402 uint32 buf_size = metafile->GetDataSize(); 402 uint32 buf_size = metafile->GetDataSize();
403 DCHECK_GT(buf_size, 0u); 403 DCHECK_GT(buf_size, 0u);
404 404
405 PrintHostMsg_DidPreviewDocument_Params preview_params; 405 PrintHostMsg_DidPreviewDocument_Params preview_params;
406 preview_params.reuse_existing_data = false; 406 preview_params.reuse_existing_data = false;
407 preview_params.data_size = buf_size; 407 preview_params.data_size = buf_size;
408 preview_params.document_cookie = print_pages_params_->params.document_cookie; 408 preview_params.document_cookie = print_pages_params_->params.document_cookie;
409 preview_params.expected_pages_count = 409 preview_params.expected_pages_count =
410 print_preview_context_.total_page_count(); 410 print_preview_context_.total_page_count();
411 preview_params.modifiable = print_preview_context_.IsModifiable(); 411 preview_params.modifiable = print_preview_context_.IsModifiable();
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 } 1103 }
1104 1104
1105 WebKit::WebNode* PrintWebViewHelper::PrintPreviewContext::node() const { 1105 WebKit::WebNode* PrintWebViewHelper::PrintPreviewContext::node() const {
1106 return node_.get(); 1106 return node_.get();
1107 } 1107 }
1108 1108
1109 int PrintWebViewHelper::PrintPreviewContext::total_page_count() const { 1109 int PrintWebViewHelper::PrintPreviewContext::total_page_count() const {
1110 return total_page_count_; 1110 return total_page_count_;
1111 } 1111 }
1112 1112
1113 printing::Metafile* PrintWebViewHelper::PrintPreviewContext::metafile() const { 1113 printing::PreviewMetafile*
1114 PrintWebViewHelper::PrintPreviewContext::metafile() const {
1114 return metafile_.get(); 1115 return metafile_.get();
1115 } 1116 }
1116 1117
1117 const PrintMsg_Print_Params& 1118 const PrintMsg_Print_Params&
1118 PrintWebViewHelper::PrintPreviewContext::print_params() const { 1119 PrintWebViewHelper::PrintPreviewContext::print_params() const {
1119 return *print_params_; 1120 return *print_params_;
1120 } 1121 }
1121 1122
1122 const gfx::Size& 1123 const gfx::Size&
1123 PrintWebViewHelper::PrintPreviewContext::GetPrintCanvasSize() const { 1124 PrintWebViewHelper::PrintPreviewContext::GetPrintCanvasSize() const {
1124 return prep_frame_view_->GetPrintCanvasSize(); 1125 return prep_frame_view_->GetPrintCanvasSize();
1125 } 1126 }
1126 1127
1127 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { 1128 void PrintWebViewHelper::PrintPreviewContext::ClearContext() {
1128 prep_frame_view_.reset(); 1129 prep_frame_view_.reset();
1129 metafile_.reset(); 1130 metafile_.reset();
1130 rendered_pages_.clear(); 1131 rendered_pages_.clear();
1131 } 1132 }
OLDNEW
« no previous file with comments | « chrome/renderer/print_web_view_helper.h ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698