summaryrefslogtreecommitdiffstats
path: root/printing/printed_document.cc
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-29 07:18:29 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-29 07:18:29 +0000
commit6ab86acd95c830be779fdddbbc1230e8b73c21bc (patch)
tree0513fe4fa922c08856287caa0d1d48a7fb6c751f /printing/printed_document.cc
parenta93885094715c2d23953f9139d61e1071d8006a5 (diff)
downloadchromium_src-6ab86acd95c830be779fdddbbc1230e8b73c21bc.zip
chromium_src-6ab86acd95c830be779fdddbbc1230e8b73c21bc.tar.gz
chromium_src-6ab86acd95c830be779fdddbbc1230e8b73c21bc.tar.bz2
Changed printer page setup units to be in device co-ordinates (this is pixels on Windows and points on the Mac). Also fixed a bug with Mac dpi calculation.
BUG=None. TEST=Test printing on Windows and Mac. Review URL: http://codereview.chromium.org/2351003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/printed_document.cc')
-rw-r--r--printing/printed_document.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/printing/printed_document.cc b/printing/printed_document.cc
index 7850073..f49e1e6 100644
--- a/printing/printed_document.cc
+++ b/printing/printed_document.cc
@@ -75,7 +75,8 @@ void PrintedDocument::SetPage(int page_number,
// be shown. Users dislike 0-based counting.
scoped_refptr<PrintedPage> page(
new PrintedPage(page_number + 1,
- metafile, immutable_.settings_.page_setup_pixels().physical_size()));
+ metafile,
+ immutable_.settings_.page_setup_device_units().physical_size()));
{
AutoLock lock(lock_);
mutable_.pages_[page_number] = page;
@@ -195,10 +196,12 @@ void PrintedDocument::PrintHeaderFooter(gfx::NativeDrawingContext context,
const gfx::Size string_size(font.GetStringWidth(output), font.height());
gfx::Rect bounding;
bounding.set_height(string_size.height());
- const gfx::Rect& overlay_area(settings.page_setup_pixels().overlay_area());
+ const gfx::Rect& overlay_area(
+ settings.page_setup_device_units().overlay_area());
// Hard code .25 cm interstice between overlays. Make sure that some space is
// kept between each headers.
- const int interstice = ConvertUnit(250, kHundrethsMMPerInch, settings.dpi());
+ const int interstice = ConvertUnit(250, kHundrethsMMPerInch,
+ settings.device_units_per_inch());
const int max_width = overlay_area.width() / 3 - interstice;
const int actual_width = std::min(string_size.width(), max_width);
switch (x) {