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

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

Issue 9699040: PrintPreview: Hide/Show the header footer option based on print frame margins. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: '' Created 8 years, 9 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 d39d666e4924aa39738980a91ad31d8619eba303..05b42b0d239cbaac73bbb25a3d5069223cf77e6a 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -126,8 +126,6 @@ var customEvents = {
MARGIN_TEXTBOX_FOCUSED: 'marginTextboxFocused',
// Fired when a new preview might be needed because of margin changes.
MARGINS_MAY_HAVE_CHANGED: 'marginsMayHaveChanged',
- // Fired when the margins selection in the dropdown changes.
- MARGINS_SELECTION_CHANGED: 'marginsSelectionChanged',
// Fired when a pdf generation related error occurs.
PDF_GENERATION_ERROR: 'PDFGenerationError',
// Fired once the first page of the pdf document is loaded in the plugin.
@@ -870,10 +868,14 @@ function onDidGetPreviewPageCount(pageCount, previewResponseId) {
/**
* @param {printing::PageSizeMargins} pageLayout The default layout of the page
* in points.
+ * @param {{x: number, y: number, width: number, height: number}} printableArea
+ Specifies the printable area details.
* @param {boolean} hasCustomPageSizeStyle Indicates whether the previewed
- * document has a custom page size style.
+ * document has a custom page size style.
*/
-function onDidGetDefaultPageLayout(pageLayout, hasCustomPageSizeStyle) {
+function onDidGetDefaultPageLayout(pageLayout,
dpapad 2012/03/17 00:36:41 Since the logic for hiding showing the header and
kmadhusu 2012/03/19 18:45:31 As per our discussion, I am going to leave this as
dpapad 2012/03/19 19:50:54 SG. Lets monitor the tracker for any complaints ab
+ printableArea,
+ hasCustomPageSizeStyle) {
hasPageSizeStyle = hasCustomPageSizeStyle;
marginSettings.currentDefaultPageLayout = new print_preview.PageLayout(
pageLayout.contentWidth,
@@ -882,6 +884,8 @@ function onDidGetDefaultPageLayout(pageLayout, hasCustomPageSizeStyle) {
pageLayout.marginTop,
pageLayout.marginRight,
pageLayout.marginBottom);
+ headerFooterSettings.checkAndHideHeaderFooterOption(
+ pageLayout, printableArea, marginSettings.selectedMarginsValue);
}
/**

Powered by Google App Engine
This is Rietveld 408576698