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

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

Issue 6759044: Prepopulating "Print To PDF" select file dialog with a suggested filename and path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remembering last used path. Created 9 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 unified diff | Download patch | Annotate | Revision Log
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 var hasPDFPlugin = true; 6 var hasPDFPlugin = true;
7 var expectedPageCount = 0; 7 var expectedPageCount = 0;
8 var pageRangesInfo = []; 8 var pageRangesInfo = [];
9 var printJobTitle = ''; 9 var printJobTitle = '';
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 var printToPDF = (printerName == localStrings.getString('printToPDF')); 208 var printToPDF = (printerName == localStrings.getString('printToPDF'));
209 209
210 return JSON.stringify({'printerName': printerName, 210 return JSON.stringify({'printerName': printerName,
211 'pageRange': pageRangesInfo, 211 'pageRange': pageRangesInfo,
212 'printAll': printAll, 212 'printAll': printAll,
213 'twoSided': twoSided, 213 'twoSided': twoSided,
214 'copies': copies, 214 'copies': copies,
215 'collate': collate, 215 'collate': collate,
216 'landscape': landscape, 216 'landscape': landscape,
217 'color': color, 217 'color': color,
218 'printToPDF': printToPDF}); 218 'printToPDF': printToPDF,
219 'printJobTitle': printJobTitle});
Lei Zhang 2011/04/14 00:15:45 just get rid of |printJobTitle| here.
dpapad 2011/04/14 02:33:35 Done.
219 } 220 }
220 221
221 /** 222 /**
222 * Asks the browser to print the preview PDF based on current print settings. 223 * Asks the browser to print the preview PDF based on current print settings.
223 */ 224 */
224 function printFile() { 225 function printFile() {
225 chrome.send('print', [getSettingsJSON()]); 226 chrome.send('print', [getSettingsJSON()]);
226 } 227 }
227 228
228 /** 229 /**
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 * Depending on the validity of 'copies' value, enables/disables the print 391 * Depending on the validity of 'copies' value, enables/disables the print
391 * button. 392 * button.
392 */ 393 */
393 function updatePrintButtonState() { 394 function updatePrintButtonState() {
394 $('print-button').disabled = (!($('all-pages').checked || 395 $('print-button').disabled = (!($('all-pages').checked ||
395 $('pages').checkValidity()) || 396 $('pages').checkValidity()) ||
396 !$('copies').checkValidity()); 397 !$('copies').checkValidity());
397 } 398 }
398 399
399 window.addEventListener('DOMContentLoaded', load); 400 window.addEventListener('DOMContentLoaded', load);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698