summaryrefslogtreecommitdiffstats
path: root/printing/print_settings.h
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/print_settings.h
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/print_settings.h')
-rw-r--r--printing/print_settings.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/printing/print_settings.h b/printing/print_settings.h
index 3a269f7..fc52aeb 100644
--- a/printing/print_settings.h
+++ b/printing/print_settings.h
@@ -41,9 +41,10 @@ class PrintSettings {
const PageRanges& new_ranges, bool print_selection_only);
#endif
- // Set printer printable area in in pixels.
- void SetPrinterPrintableArea(gfx::Size const& physical_size_pixels,
- gfx::Rect const& printable_area_pixels);
+ // Set printer printable area in in device units.
+ void SetPrinterPrintableArea(gfx::Size const& physical_size_device_units,
+ gfx::Rect const& printable_area_device_units,
+ int units_per_inch);
// Equality operator.
// NOTE: printer_name is NOT tested for equality since it doesn't affect the
@@ -56,7 +57,16 @@ class PrintSettings {
}
const std::wstring& device_name() const { return device_name_; }
int dpi() const { return dpi_; }
- const PageSetup& page_setup_pixels() const { return page_setup_pixels_; }
+ const PageSetup& page_setup_device_units() const {
+ return page_setup_device_units_;
+ }
+ int device_units_per_inch() const {
+#if defined(OS_MACOSX)
+ return 72;
+#else // defined(OS_MACOSX)
+ return dpi();
+#endif // defined(OS_MACOSX)
+ }
// Multi-page printing. Each PageRange describes a from-to page combination.
// This permits printing selected pages only.
@@ -105,8 +115,8 @@ class PrintSettings {
// Printer device name as opened by the OS.
std::wstring device_name_;
- // Page setup in pixel units, dpi adjusted.
- PageSetup page_setup_pixels_;
+ // Page setup in device units.
+ PageSetup page_setup_device_units_;
// Printer's device effective dots per inch in both axis.
int dpi_;