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

Side by Side Diff: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js

Issue 2866163003: [CUPS] Only allow set up a printer if manufacturer & model or the PPD file is specified. (Closed)
Patch Set: set up. Created 3 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
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview 'settings-cups-add-printer-dialog' includes multiple dialogs to 6 * @fileoverview 'settings-cups-add-printer-dialog' includes multiple dialogs to
7 * set up a new CUPS printer. 7 * set up a new CUPS printer.
8 * Subdialogs include: 8 * Subdialogs include:
9 * - 'add-printer-discovery-dialog' is a dialog showing discovered printers on 9 * - 'add-printer-discovery-dialog' is a dialog showing discovered printers on
10 * the network that are available for setup. 10 * the network that are available for setup.
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 }, 280 },
281 281
282 /** 282 /**
283 * @param {string} path The full path of the file 283 * @param {string} path The full path of the file
284 * @return {string} The base name of the file 284 * @return {string} The base name of the file
285 * @private 285 * @private
286 */ 286 */
287 getBaseName_: function(path) { 287 getBaseName_: function(path) {
288 return path.substring(path.lastIndexOf('/') + 1); 288 return path.substring(path.lastIndexOf('/') + 1);
289 }, 289 },
290
291 /**
292 * @param {string} printerManufacturer
293 * @param {string} printerModel
294 * @param {string} printerPPDPath
295 * @return {boolean} Whether we have enough information to set up the printer
296 * @private
297 */
298 canAddPrinter_: function(printerManufacturer, printerModel, printerPPDPath) {
299 if ((printerManufacturer && printerModel) || printerPPDPath)
michaelpg 2017/05/08 23:46:57 nit: just return ((pM && pM) || pP) directly inste
xdai1 2017/05/09 00:34:23 Done.
300 return true;
301 return false;
302 },
290 }); 303 });
291 304
292 Polymer({ 305 Polymer({
293 is: 'add-printer-configuring-dialog', 306 is: 'add-printer-configuring-dialog',
294 307
295 properties: { 308 properties: {
296 printerName: String, 309 printerName: String,
297 dialogTitle: String, 310 dialogTitle: String,
298 }, 311 },
299 312
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 onAddPrinter_: function(success, printerName) { 511 onAddPrinter_: function(success, printerName) {
499 this.$$('add-printer-configuring-dialog').close(); 512 this.$$('add-printer-configuring-dialog').close();
500 if (success) 513 if (success)
501 return; 514 return;
502 515
503 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { 516 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) {
504 this.setupFailed = true; 517 this.setupFailed = true;
505 } 518 }
506 }, 519 },
507 }); 520 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698