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

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

Issue 2835793002: Print Preview: Assign to the header summary label only once. (Closed)
Patch Set: nit Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/print_header.js
diff --git a/chrome/browser/resources/print_preview/print_header.js b/chrome/browser/resources/print_preview/print_header.js
index 7b9b8ded9506c6fb5f94cc9ff09f49ed55021a46..8314a11fa0e422ac5f00d3f56ecc6f94b9ce0bea 100644
--- a/chrome/browser/resources/print_preview/print_header.js
+++ b/chrome/browser/resources/print_preview/print_header.js
@@ -159,18 +159,11 @@ cr.define('print_preview', function() {
return;
}
- var summaryLabel =
- loadTimeData.getString('printPreviewSheetsLabelSingular');
- var pagesLabel = loadTimeData.getString('printPreviewPageLabelPlural');
-
var saveToPdfOrDrive = this.destinationStore_.selectedDestination &&
(this.destinationStore_.selectedDestination.id ==
print_preview.Destination.GooglePromotedId.SAVE_AS_PDF ||
this.destinationStore_.selectedDestination.id ==
print_preview.Destination.GooglePromotedId.DOCS);
- if (saveToPdfOrDrive) {
- summaryLabel = loadTimeData.getString('printPreviewPageLabelSingular');
- }
var numPages = this.printTicketStore_.pageRange.getPageNumberSet().size;
var numSheets = numPages;
@@ -182,9 +175,15 @@ cr.define('print_preview', function() {
numSheets *= copies;
numPages *= copies;
+ var pagesLabel = loadTimeData.getString('printPreviewPageLabelPlural');
+ var summaryLabel;
if (numSheets > 1) {
summaryLabel = saveToPdfOrDrive ? pagesLabel :
loadTimeData.getString('printPreviewSheetsLabelPlural');
+ } else {
+ summaryLabel = loadTimeData.getString(
+ saveToPdfOrDrive ? 'printPreviewPageLabelSingular' :
+ 'printPreviewSheetsLabelSingular');
}
var html;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698