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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // require: cr/ui/print_preview_cloud.js 5 // require: cr/ui/print_preview_cloud.js
6 6
7 var localStrings = new LocalStrings(); 7 var localStrings = new LocalStrings();
8 8
9 // If useCloudPrint is true we attempt to connect to cloud print 9 // If useCloudPrint is true we attempt to connect to cloud print
10 // and populate the list of printers with cloud print printers. 10 // and populate the list of printers with cloud print printers.
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 return; 865 return;
866 866
867 cr.dispatchSimpleEvent(document, customEvents.UPDATE_SUMMARY); 867 cr.dispatchSimpleEvent(document, customEvents.UPDATE_SUMMARY);
868 } 868 }
869 869
870 /** 870 /**
871 * @param {printing::PageSizeMargins} pageLayout The default layout of the page 871 * @param {printing::PageSizeMargins} pageLayout The default layout of the page
872 * in points. 872 * in points.
873 * @param {boolean} hasCustomPageSizeStyle Indicates whether the previewed 873 * @param {boolean} hasCustomPageSizeStyle Indicates whether the previewed
874 * document has a custom page size style. 874 * document has a custom page size style.
875 * @param {boolean} headerFooterApplies Indicates whether the header
876 * footer is applicable for the given settings.
875 */ 877 */
876 function onDidGetDefaultPageLayout(pageLayout, hasCustomPageSizeStyle) { 878 function onDidGetDefaultPageLayout(pageLayout,
879 hasCustomPageSizeStyle,
880 headerFooterApplies) {
877 hasPageSizeStyle = hasCustomPageSizeStyle; 881 hasPageSizeStyle = hasCustomPageSizeStyle;
878 marginSettings.currentDefaultPageLayout = new print_preview.PageLayout( 882 marginSettings.currentDefaultPageLayout = new print_preview.PageLayout(
879 pageLayout.contentWidth, 883 pageLayout.contentWidth,
880 pageLayout.contentHeight, 884 pageLayout.contentHeight,
881 pageLayout.marginLeft, 885 pageLayout.marginLeft,
882 pageLayout.marginTop, 886 pageLayout.marginTop,
883 pageLayout.marginRight, 887 pageLayout.marginRight,
884 pageLayout.marginBottom); 888 pageLayout.marginBottom);
889 headerFooterSettings.setVisibility(headerFooterApplies);
885 } 890 }
886 891
887 /** 892 /**
888 * This function sends a request to hide the overlay layer only if there is no 893 * This function sends a request to hide the overlay layer only if there is no
889 * pending print document request and we are not waiting for the print ready 894 * pending print document request and we are not waiting for the print ready
890 * metafile. 895 * metafile.
891 */ 896 */
892 function checkAndHideOverlayLayerIfValid() { 897 function checkAndHideOverlayLayerIfValid() {
893 var selectedPrinter = getSelectedPrinterName(); 898 var selectedPrinter = getSelectedPrinterName();
894 var printToDialog = selectedPrinter == PRINT_TO_PDF || 899 var printToDialog = selectedPrinter == PRINT_TO_PDF ||
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 <include src="copies_settings.js"/> 1207 <include src="copies_settings.js"/>
1203 <include src="header_footer_settings.js"/> 1208 <include src="header_footer_settings.js"/>
1204 <include src="layout_settings.js"/> 1209 <include src="layout_settings.js"/>
1205 <include src="color_settings.js"/> 1210 <include src="color_settings.js"/>
1206 <include src="margin_settings.js"/> 1211 <include src="margin_settings.js"/>
1207 <include src="margin_textbox.js"/> 1212 <include src="margin_textbox.js"/>
1208 <include src="margin_utils.js"/> 1213 <include src="margin_utils.js"/>
1209 <include src="margins_ui.js"/> 1214 <include src="margins_ui.js"/>
1210 <include src="margins_ui_pair.js"/> 1215 <include src="margins_ui_pair.js"/>
1211 <include src="preview_area.js"/> 1216 <include src="preview_area.js"/>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698