summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authorphoglund <phoglund@chromium.org>2016-02-15 08:44:30 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-15 16:45:32 +0000
commit6101f99726f29e1f2c3def535fe65a48a9b16ee3 (patch)
tree29e07aa271342b70452243cceecf830e1ce501d1 /printing
parentba8c3576bbf3325e82d7f6d51052f8f9486ec6b7 (diff)
downloadchromium_src-6101f99726f29e1f2c3def535fe65a48a9b16ee3.zip
chromium_src-6101f99726f29e1f2c3def535fe65a48a9b16ee3.tar.gz
chromium_src-6101f99726f29e1f2c3def535fe65a48a9b16ee3.tar.bz2
Revert of Cleanup: Remove unused PrintSettings shrink factors. (patchset #1 id:1 of https://codereview.chromium.org/1676953003/ )
Reason for revert: Seems to break printing WebKit Linux MSAN (test times out): https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20MSAN/builds/8511 Original issue's description: > Cleanup: Remove unused PrintSettings shrink factors. > > - They have been unused for 7 years. > - The copy that is being used eventually moved to > third_party/WebKit/Source/core/page/PrintContext.cpp. > > Committed: https://crrev.com/5e8544fc5972711c5237e3bcd8c018a0b439f4f1 > Cr-Commit-Position: refs/heads/master@{#374553} TBR=vitalybuka@chromium.org,tsepez@chromium.org,thestig@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. Review URL: https://codereview.chromium.org/1697183002 Cr-Commit-Position: refs/heads/master@{#375464}
Diffstat (limited to 'printing')
-rw-r--r--printing/print_settings.cc2
-rw-r--r--printing/print_settings.h17
-rw-r--r--printing/print_settings_conversion.cc2
3 files changed, 21 insertions, 0 deletions
diff --git a/printing/print_settings.cc b/printing/print_settings.cc
index 159cfa5..7f555f0 100644
--- a/printing/print_settings.cc
+++ b/printing/print_settings.cc
@@ -131,6 +131,8 @@ PrintSettings::~PrintSettings() {
void PrintSettings::Clear() {
ranges_.clear();
margin_type_ = DEFAULT_MARGINS;
+ min_shrink_ = 1.25;
+ max_shrink_ = 2.;
desired_dpi_ = 72;
selection_only_ = false;
title_ = base::string16();
diff --git a/printing/print_settings.h b/printing/print_settings.h
index 6c4f8e7..08c7d56 100644
--- a/printing/print_settings.h
+++ b/printing/print_settings.h
@@ -143,6 +143,10 @@ class PRINTING_EXPORT PrintSettings {
int desired_dpi() const { return desired_dpi_; }
+ double max_shrink() const { return max_shrink_; }
+
+ double min_shrink() const { return min_shrink_; }
+
// Cookie generator. It is used to initialize PrintedDocument with its
// associated PrintSettings, to be sure that each generated PrintedPage is
// correctly associated with its corresponding PrintedDocument.
@@ -153,6 +157,19 @@ class PRINTING_EXPORT PrintSettings {
// This permits printing selected pages only.
PageRanges ranges_;
+ // By imaging to a width a little wider than the available pixels, thin pages
+ // will be scaled down a little, matching the way they print in IE and Camino.
+ // This lets them use fewer sheets than they would otherwise, which is
+ // presumably why other browsers do this. Wide pages will be scaled down more
+ // than this.
+ double min_shrink_;
+
+ // This number determines how small we are willing to reduce the page content
+ // in order to accommodate the widest line. If the page would have to be
+ // reduced smaller to make the widest line fit, we just clip instead (this
+ // behavior matches MacIE and Mozilla, at least)
+ double max_shrink_;
+
// Desired visible dots per inch rendering for output. Printing should be
// scaled to ScreenDpi/dpix*desired_dpi.
int desired_dpi_;
diff --git a/printing/print_settings_conversion.cc b/printing/print_settings_conversion.cc
index 6200d7c..cd0c059 100644
--- a/printing/print_settings_conversion.cc
+++ b/printing/print_settings_conversion.cc
@@ -227,6 +227,8 @@ void PrintSettingsToJobSettingsDebug(const PrintSettings& settings,
// common public constants. So just serialize in "debug" section.
base::DictionaryValue* debug = new base::DictionaryValue;
job_settings->Set("debug", debug);
+ debug->SetDouble("minShrink", settings.min_shrink());
+ debug->SetDouble("maxShrink", settings.max_shrink());
debug->SetInteger("desiredDpi", settings.desired_dpi());
debug->SetInteger("dpi", settings.dpi());
debug->SetInteger("deviceUnitsPerInch", settings.device_units_per_inch());