summaryrefslogtreecommitdiffstats
path: root/printing/print_settings.cc
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 05:29:07 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 05:29:07 +0000
commit38bba4f8e2f93dd789c3483a3f0c153ca5809793 (patch)
tree18ec7bd6d8cf84dd7492b1f986f210621a79db00 /printing/print_settings.cc
parent31548a10135c11ff689074896237d2b7a404959c (diff)
downloadchromium_src-38bba4f8e2f93dd789c3483a3f0c153ca5809793.zip
chromium_src-38bba4f8e2f93dd789c3483a3f0c153ca5809793.tar.gz
chromium_src-38bba4f8e2f93dd789c3483a3f0c153ca5809793.tar.bz2
Changes made to the printing logic to allow plugins to participate in the browser's print workflow. These changes mainly involve allowing the plugin to specify
whether it wants the browser to use overlays and also changes to the EMF code on Windows to decompress JPEGs/PNGs in the metafile. The related webkit change is https://bugs.webkit.org/show_bug.cgi?id=35550 BUG=None TEST=Test printing with new Pepper plugins that support custom printing. Review URL: http://codereview.chromium.org/745001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/print_settings.cc')
-rw-r--r--printing/print_settings.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/printing/print_settings.cc b/printing/print_settings.cc
index 4764952..77c4049 100644
--- a/printing/print_settings.cc
+++ b/printing/print_settings.cc
@@ -19,6 +19,7 @@ PrintSettings::PrintSettings()
max_shrink(2.0),
desired_dpi(72),
selection_only(false),
+ use_overlays(true),
dpi_(0),
landscape_(false) {
}
@@ -120,16 +121,19 @@ void PrintSettings::SetPrinterPrintableArea(
gfx::Size const& physical_size_pixels,
gfx::Rect const& printable_area_pixels) {
- // Hard-code text_height = 0.5cm = ~1/5 of inch.
- int header_footer_text_height = ConvertUnit(500, kHundrethsMMPerInch, dpi_);
-
+ int header_footer_text_height = 0;
+ int margin_printer_units = 0;
+ if (use_overlays) {
+ // Hard-code text_height = 0.5cm = ~1/5 of inch.
+ header_footer_text_height = ConvertUnit(500, kHundrethsMMPerInch, dpi_);
+ // Default margins 1.0cm = ~2/5 of an inch.
+ margin_printer_units = ConvertUnit(1000, kHundrethsMMPerInch, dpi_);
+ }
// Start by setting the user configuration
page_setup_pixels_.Init(physical_size_pixels,
printable_area_pixels,
header_footer_text_height);
- // Default margins 1.0cm = ~2/5 of an inch.
- int margin_printer_units = ConvertUnit(1000, kHundrethsMMPerInch, dpi_);
// Apply default margins (not user configurable just yet).
// Since the font height is half the margin we put the header and footers at