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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 8344016: Fix print media page size by using the value we compute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.cc
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 6cd03b793d38593bc0ba6997fb939bcf316b8f21..27e55c3eeb3f84251757cae24936479463818443 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -1381,8 +1381,6 @@ bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument(
DCHECK_EQ(INITIALIZED, state_);
state_ = RENDERING;
- print_params_.reset(new PrintMsg_Print_Params(*print_params));
-
metafile_.reset(new printing::PreviewMetafile);
if (!metafile_->Init()) {
set_error(PREVIEW_ERROR_METAFILE_INIT_FAILED);
@@ -1396,6 +1394,8 @@ bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument(
UpdatePrintableSizeInPrintParameters(frame_, node_,
prep_frame_view_.get(), print_params);
+ print_params_.reset(new PrintMsg_Print_Params(*print_params));
+
total_page_count_ = prep_frame_view_->GetExpectedPageCount();
if (total_page_count_ == 0) {
LOG(ERROR) << "CreatePreviewDocument got 0 page count";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698