| OLD | NEW |
| 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 Loading... |
| 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 return !!((printerManufacturer && printerModel) || printerPPDPath); |
| 300 }, |
| 290 }); | 301 }); |
| 291 | 302 |
| 292 Polymer({ | 303 Polymer({ |
| 293 is: 'add-printer-configuring-dialog', | 304 is: 'add-printer-configuring-dialog', |
| 294 | 305 |
| 295 properties: { | 306 properties: { |
| 296 printerName: String, | 307 printerName: String, |
| 297 dialogTitle: String, | 308 dialogTitle: String, |
| 298 }, | 309 }, |
| 299 | 310 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 onAddPrinter_: function(success, printerName) { | 509 onAddPrinter_: function(success, printerName) { |
| 499 this.$$('add-printer-configuring-dialog').close(); | 510 this.$$('add-printer-configuring-dialog').close(); |
| 500 if (success) | 511 if (success) |
| 501 return; | 512 return; |
| 502 | 513 |
| 503 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { | 514 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { |
| 504 this.setupFailed = true; | 515 this.setupFailed = true; |
| 505 } | 516 } |
| 506 }, | 517 }, |
| 507 }); | 518 }); |
| OLD | NEW |