Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: chrome/browser/resources/print_preview/print_preview.js

Issue 8585017: PrintPreview: Honor the print media page size and margin values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added one more test Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index beaced673c027d872017b3102d5eea87599b6ba4..e45aa60a6342aa55bdcfdf46bb754b8b66eb441b 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -16,6 +16,9 @@ var lastSelectedPrinterIndex = 0;
// Used to disable some printing options when the preview is not modifiable.
var previewModifiable = false;
+// Used to identify whether the printing frame has specific page size style.
+var hasPageSizeStyle = false;
+
// Destination list special value constants.
const MANAGE_CLOUD_PRINTERS = 'manageCloudPrinters';
const MANAGE_LOCAL_PRINTERS = 'manageLocalPrinters';
@@ -835,7 +838,7 @@ function setPluginPreviewPageCount() {
* Called from PrintPreviewUI::OnDidGetPreviewPageCount().
* @param {number} pageCount The number of pages.
* @param {number} previewResponseId The preview request id that resulted in
- * this response.
+ * this response.
*/
function onDidGetPreviewPageCount(pageCount, previewResponseId) {
if (!isExpectedPreviewResponse(previewResponseId))
@@ -850,8 +853,11 @@ function onDidGetPreviewPageCount(pageCount, previewResponseId) {
/**
* @param {printing::PageSizeMargins} pageLayout The default layout of the page
* in points.
+ * @param {boolean} hasCustomPageSizeStyle Indicates whether the previewed
+ * document has a custom page size style.
*/
-function onDidGetDefaultPageLayout(pageLayout) {
+function onDidGetDefaultPageLayout(pageLayout, hasCustomPageSizeStyle) {
+ hasPageSizeStyle = hasCustomPageSizeStyle;
marginSettings.currentDefaultPageLayout = new print_preview.PageLayout(
pageLayout.contentWidth,
pageLayout.contentHeight,
« no previous file with comments | « chrome/browser/resources/print_preview/layout_settings.js ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698