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

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

Issue 7064006: Print Preview: Fixing printer list when no printer is installed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing console.log() Created 9 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 var localStrings = new LocalStrings(); 5 var localStrings = new LocalStrings();
6 6
7 // The total page count of the previewed document regardless of which pages the 7 // The total page count of the previewed document regardless of which pages the
8 // user has selected. 8 // user has selected.
9 var totalPageCount = -1; 9 var totalPageCount = -1;
10 10
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 * Called from PrintPreviewHandler::SendPrinterList(). 331 * Called from PrintPreviewHandler::SendPrinterList().
332 * @param {Array} printers Array of printer info objects. 332 * @param {Array} printers Array of printer info objects.
333 * @param {number} defaultPrinterIndex The index of the default printer. 333 * @param {number} defaultPrinterIndex The index of the default printer.
334 */ 334 */
335 function setPrinters(printers, defaultPrinterIndex) { 335 function setPrinters(printers, defaultPrinterIndex) {
336 var printerList = $('printer-list'); 336 var printerList = $('printer-list');
337 for (var i = 0; i < printers.length; ++i) { 337 for (var i = 0; i < printers.length; ++i) {
338 addDestinationListOption(printers[i].printerName, printers[i].deviceName, 338 addDestinationListOption(printers[i].printerName, printers[i].deviceName,
339 i == defaultPrinterIndex, false); 339 i == defaultPrinterIndex, false);
340 } 340 }
341 addDestinationListOption('','',false, true); 341
342 if (printers.length != 0)
343 addDestinationListOption('','',false, true);
Lei Zhang 2011/05/23 21:46:19 nit: can you put a space after the comma here and
342 344
343 // Adding option for saving PDF to disk. 345 // Adding option for saving PDF to disk.
344 addDestinationListOption(localStrings.getString('printToPDF'), 346 addDestinationListOption(localStrings.getString('printToPDF'),
345 PRINT_TO_PDF, false, false); 347 PRINT_TO_PDF, false, false);
346 addDestinationListOption('','',false, true); 348 addDestinationListOption('','',false, true);
347 349
348 // Add an option to manage printers. 350 // Add an option to manage printers.
349 addDestinationListOption(localStrings.getString('managePrinters'), 351 addDestinationListOption(localStrings.getString('managePrinters'),
350 MANAGE_PRINTERS, false, false); 352 MANAGE_PRINTERS, false, false);
351 353
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 copiesField.value = 1; 903 copiesField.value = 1;
902 else { 904 else {
903 var newValue = getCopies() + sign * 1; 905 var newValue = getCopies() + sign * 1;
904 if (newValue < copiesField.min || newValue > copiesField.max) 906 if (newValue < copiesField.min || newValue > copiesField.max)
905 return; 907 return;
906 copiesField.value = newValue; 908 copiesField.value = newValue;
907 } 909 }
908 copiesFieldChanged(); 910 copiesFieldChanged();
909 } 911 }
910 912
OLDNEW
« 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