summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authoraayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 19:56:18 +0000
committeraayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 19:56:18 +0000
commit7a9b03e386c6ca34575c1819ba0ad413a15e2d76 (patch)
tree84b7a18a28042a7d4b6d0f14e4126a666fd68c54 /printing
parent12dd463c5497498e49214ae186c681adcbcd445c (diff)
downloadchromium_src-7a9b03e386c6ca34575c1819ba0ad413a15e2d76.zip
chromium_src-7a9b03e386c6ca34575c1819ba0ad413a15e2d76.tar.gz
chromium_src-7a9b03e386c6ca34575c1819ba0ad413a15e2d76.tar.bz2
Backend changes for custom margins.
The UI for margin options are hidden by default. BUG=69337 TEST= There is currently minimal UI for testing this. The custom margins option does nothing. You can however click the no margins option to see the page print without margins. Review URL: http://codereview.chromium.org/7552033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/page_size_margins.h24
-rw-r--r--printing/print_job_constants.cc25
-rw-r--r--printing/print_job_constants.h8
-rw-r--r--printing/printing.gyp1
4 files changed, 58 insertions, 0 deletions
diff --git a/printing/page_size_margins.h b/printing/page_size_margins.h
new file mode 100644
index 0000000..4f74c297
--- /dev/null
+++ b/printing/page_size_margins.h
@@ -0,0 +1,24 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PRINTING_PAGE_SIZE_MARGINS_H_
+#define PRINTING_PAGE_SIZE_MARGINS_H_
+
+namespace printing {
+
+// Struct that holds margin and content area sizes of a page. Units are
+// arbitrary and can be chosen by the programmer.
+struct PageSizeMargins {
+ double content_width;
+ double content_height;
+ double margin_top;
+ double margin_right;
+ double margin_bottom;
+ double margin_left;
+};
+
+} // namespace printing
+
+#endif // PRINTING_PAGE_SIZE_MARGINS_H_
+
diff --git a/printing/print_job_constants.cc b/printing/print_job_constants.cc
index b1928e5..5e7863e 100644
--- a/printing/print_job_constants.cc
+++ b/printing/print_job_constants.cc
@@ -24,9 +24,19 @@ const char kSettingCollate[] = "collate";
// Print out color: true for color, false for grayscale.
const char kSettingColor[] = "color";
+// Key that specifies the height of the content area of the page.
+const char kSettingContentHeight[] = "contentHeight";
+
+// Key that specifies the width of the content area of the page.
+const char kSettingContentWidth[] = "contentWidth";
+
// Number of copies.
const char kSettingCopies[] = "copies";
+// Key that specifies if the default margins have been selected or not.
+// True if selected, false if not.
+const char kSettingDefaultMarginsSelected[] = "defaultMarginsSelected";
+
// Device name: Unique printer identifier.
const char kSettingDeviceName[] = "deviceName";
@@ -71,6 +81,21 @@ const char kSettingHeaderFooterURL[] = "url";
// Page orientation: true for landscape, false for portrait.
const char kSettingLandscape[] = "landscape";
+// Key that specifies the bottom margin of the page.
+const char kSettingMarginBottom[] = "marginBottom";
+
+// Key that specifies the left margin of the page.
+const char kSettingMarginLeft[] = "marginLeft";
+
+// Key that specifies the right margin of the page.
+const char kSettingMarginRight[] = "marginRight";
+
+// Key that specifies the top margin of the page.
+const char kSettingMarginTop[] = "marginTop";
+
+// Key that specifies the array of custom margins as set by the user.
+const char kSettingMargins[] = "margins";
+
// A page range.
const char kSettingPageRange[] = "pageRange";
diff --git a/printing/print_job_constants.h b/printing/print_job_constants.h
index e451189..5739ab9 100644
--- a/printing/print_job_constants.h
+++ b/printing/print_job_constants.h
@@ -13,7 +13,10 @@ extern const char kPreviewUIAddr[];
extern const char kSettingCloudPrintId[];
extern const char kSettingCollate[];
extern const char kSettingColor[];
+extern const char kSettingContentHeight[];
+extern const char kSettingContentWidth[];
extern const char kSettingCopies[];
+extern const char kSettingDefaultMarginsSelected[];
extern const char kSettingDeviceName[];
extern const char kSettingDuplexMode[];
extern const char kSettingHeaderFooterEnabled[];
@@ -27,6 +30,11 @@ extern const char kSettingHeaderFooterDate[];
extern const char kSettingHeaderFooterTitle[];
extern const char kSettingHeaderFooterURL[];
extern const char kSettingLandscape[];
+extern const char kSettingMarginBottom[];
+extern const char kSettingMarginLeft[];
+extern const char kSettingMarginRight[];
+extern const char kSettingMarginTop[];
+extern const char kSettingMargins[];
extern const char kSettingPageRange[];
extern const char kSettingPageRangeFrom[];
extern const char kSettingPageRangeTo[];
diff --git a/printing/printing.gyp b/printing/printing.gyp
index 4f5483f..0b13a00 100644
--- a/printing/printing.gyp
+++ b/printing/printing.gyp
@@ -46,6 +46,7 @@
'page_range.h',
'page_setup.cc',
'page_setup.h',
+ 'page_size_margins.h',
'pdf_metafile_cairo_linux.cc',
'pdf_metafile_cairo_linux.h',
'pdf_metafile_cg_mac.cc',