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

Side by Side Diff: chrome/browser/resources/print_preview/print_header.js

Issue 697463002: print preview: more voice feedback issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Creates a PrintHeader object. This object encapsulates all the elements 9 * Creates a PrintHeader object. This object encapsulates all the elements
10 * and logic related to the top part of the left pane in print_preview.html. 10 * and logic related to the top part of the left pane in print_preview.html.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 var copies = this.printTicketStore_.copies.getValueAsNumber(); 177 var copies = this.printTicketStore_.copies.getValueAsNumber();
178 numSheets *= copies; 178 numSheets *= copies;
179 numPages *= copies; 179 numPages *= copies;
180 180
181 if (numSheets > 1) { 181 if (numSheets > 1) {
182 summaryLabel = saveToPdf ? pagesLabel : 182 summaryLabel = saveToPdf ? pagesLabel :
183 loadTimeData.getString('printPreviewSheetsLabelPlural'); 183 loadTimeData.getString('printPreviewSheetsLabelPlural');
184 } 184 }
185 185
186 var html; 186 var html;
187 var label;
187 if (numPages != numSheets) { 188 if (numPages != numSheets) {
188 html = loadTimeData.getStringF('printPreviewSummaryFormatLong', 189 html = loadTimeData.getStringF('printPreviewSummaryFormatLong',
189 '<b>' + numSheets + '</b>', 190 '<b>' + numSheets + '</b>',
190 '<b>' + summaryLabel + '</b>', 191 '<b>' + summaryLabel + '</b>',
191 numPages, 192 numPages,
192 pagesLabel); 193 pagesLabel);
194 label = loadTimeData.getStringF('printPreviewSummaryFormatLong',
195 numSheets, summaryLabel,
196 numPages, pagesLabel);
193 } else { 197 } else {
194 html = loadTimeData.getStringF('printPreviewSummaryFormatShort', 198 html = loadTimeData.getStringF('printPreviewSummaryFormatShort',
195 '<b>' + numSheets + '</b>', 199 '<b>' + numSheets + '</b>',
196 '<b>' + summaryLabel + '</b>'); 200 '<b>' + summaryLabel + '</b>');
201 label = loadTimeData.getStringF('printPreviewSummaryFormatShort',
202 numSheets, summaryLabel);
197 } 203 }
198 204
199 // Removing extra spaces from within the string. 205 // Removing extra spaces from within the string.
200 html = html.replace(/\s{2,}/g, ' '); 206 html = html.replace(/\s{2,}/g, ' ');
201 this.getChildElement('.summary').innerHTML = html; 207
208 var summary = this.getChildElement('.summary');
209 summary.innerHTML = html;
210 summary.setAttribute('aria-label', label);
202 }, 211 },
203 212
204 /** 213 /**
205 * Called when the print button is clicked. Dispatches a PRINT_DOCUMENT 214 * Called when the print button is clicked. Dispatches a PRINT_DOCUMENT
206 * common event. 215 * common event.
207 * @private 216 * @private
208 */ 217 */
209 onPrintButtonClick_: function() { 218 onPrintButtonClick_: function() {
210 if (this.destinationStore_.selectedDestination.id != 219 if (this.destinationStore_.selectedDestination.id !=
211 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF) { 220 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 this.getChildElement('button.print').focus(); 266 this.getChildElement('button.print').focus();
258 } 267 }
259 } 268 }
260 }; 269 };
261 270
262 // Export 271 // Export
263 return { 272 return {
264 PrintHeader: PrintHeader 273 PrintHeader: PrintHeader
265 }; 274 };
266 }); 275 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698