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

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: 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 var printToPDF = (printerName == localStrings.getString('printToPDF')); 198 var printToPDF = (printerName == localStrings.getString('printToPDF'));
199 199
200 return JSON.stringify({'printerName': printerName, 200 return JSON.stringify({'printerName': printerName,
201 'pageRange': pageRangesInfo, 201 'pageRange': pageRangesInfo,
202 'printAll': printAll, 202 'printAll': printAll,
203 'twoSided': twoSided, 203 'twoSided': twoSided,
204 'copies': copies, 204 'copies': copies,
205 'collate': collate, 205 'collate': collate,
206 'landscape': landscape, 206 'landscape': landscape,
207 'color': color, 207 'color': color,
208 'printToPDF': printToPDF}); 208 'printToPDF': printToPDF,
209 'printJobTitle': printJobTitle});
Lei Zhang 2011/04/01 01:05:35 I actually want to get rid of printJobTitle altoge
209 } 210 }
210 211
211 /** 212 /**
212 * Asks the browser to print the preview PDF based on current print settings. 213 * Asks the browser to print the preview PDF based on current print settings.
213 */ 214 */
214 function printFile() { 215 function printFile() {
215 chrome.send('print', [getSettingsJSON()]); 216 chrome.send('print', [getSettingsJSON()]);
216 } 217 }
217 218
218 /** 219 /**
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 * Depending on the validity of 'copies' value, enables/disables the print 378 * Depending on the validity of 'copies' value, enables/disables the print
378 * button. 379 * button.
379 */ 380 */
380 function updatePrintButtonState() { 381 function updatePrintButtonState() {
381 $('print-button').disabled = (!($('all-pages').checked || 382 $('print-button').disabled = (!($('all-pages').checked ||
382 $('pages').checkValidity()) || 383 $('pages').checkValidity()) ||
383 !$('copies').checkValidity()); 384 !$('copies').checkValidity());
384 } 385 }
385 386
386 window.addEventListener('DOMContentLoaded', load); 387 window.addEventListener('DOMContentLoaded', load);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview_handler.h » ('j') | chrome/browser/ui/webui/print_preview_handler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698