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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 10071024: Fixed issue with shrink output when using system print dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | « chrome/renderer/print_web_view_helper.h ('k') | chrome/renderer/print_web_view_helper_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.cc
===================================================================
--- chrome/renderer/print_web_view_helper.cc (revision 132045)
+++ chrome/renderer/print_web_view_helper.cc (working copy)
@@ -6,6 +6,7 @@
#include <string>
+#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -665,7 +666,8 @@
fit_to_page_(true),
user_cancelled_scripted_print_count_(0),
is_scripted_printing_blocked_(false),
- notify_browser_of_print_failure_(true) {
+ notify_browser_of_print_failure_(true),
+ print_for_preview_(false) {
}
PrintWebViewHelper::~PrintWebViewHelper() {}
@@ -743,8 +745,15 @@
return;
}
+ // Set print_for_preview_ flag and autoreset it to back to original
Lei Zhang 2012/04/13 22:15:08 nit: |print_for_preview_| and same below.
gene 2012/04/13 22:18:17 Done.
+ // on return.
+ AutoReset<bool> set_printing_flag(&print_for_preview_, true);
+
WebFrame* pdf_frame = pdf_element.document().frame();
- if (!UpdatePrintSettings(pdf_frame, pdf_element, job_settings, true)) {
+ // TODO(gene): Consider using print_for_preview_ inside UpdatePrintSettings
+ // instead of passing this as parameter.
+ if (!UpdatePrintSettings(pdf_frame, pdf_element,
+ job_settings, print_for_preview_)) {
LOG(ERROR) << "UpdatePrintSettings failed";
DidFinishPrinting(FAIL_PRINT);
return;
« no previous file with comments | « chrome/renderer/print_web_view_helper.h ('k') | chrome/renderer/print_web_view_helper_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698