| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 getCupsPrinterManufacturersList().then( | 215 getCupsPrinterManufacturersList().then( |
| 216 this.manufacturerListChanged_.bind(this)); | 216 this.manufacturerListChanged_.bind(this)); |
| 217 }, | 217 }, |
| 218 | 218 |
| 219 /** | 219 /** |
| 220 * @param {string} manufacturer The manufacturer for which we are retrieving | 220 * @param {string} manufacturer The manufacturer for which we are retrieving |
| 221 * models. | 221 * models. |
| 222 * @private | 222 * @private |
| 223 */ | 223 */ |
| 224 selectedManufacturerChanged_: function(manufacturer) { | 224 selectedManufacturerChanged_: function(manufacturer) { |
| 225 // Reset model if manufacturer is changed. |
| 226 this.set('newPrinter.printerModel', ''); |
| 225 if (manufacturer) { | 227 if (manufacturer) { |
| 226 settings.CupsPrintersBrowserProxyImpl.getInstance() | 228 settings.CupsPrintersBrowserProxyImpl.getInstance() |
| 227 .getCupsPrinterModelsList(manufacturer) | 229 .getCupsPrinterModelsList(manufacturer) |
| 228 .then(this.modelListChanged_.bind(this)); | 230 .then(this.modelListChanged_.bind(this)); |
| 229 } | 231 } |
| 230 }, | 232 }, |
| 231 | 233 |
| 232 /** @private */ | 234 /** @private */ |
| 233 onBrowseFile_: function() { | 235 onBrowseFile_: function() { |
| 234 settings.CupsPrintersBrowserProxyImpl.getInstance(). | 236 settings.CupsPrintersBrowserProxyImpl.getInstance(). |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 onAddPrinter_: function(success, printerName) { | 500 onAddPrinter_: function(success, printerName) { |
| 499 this.$$('add-printer-configuring-dialog').close(); | 501 this.$$('add-printer-configuring-dialog').close(); |
| 500 if (success) | 502 if (success) |
| 501 return; | 503 return; |
| 502 | 504 |
| 503 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { | 505 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { |
| 504 this.setupFailed = true; | 506 this.setupFailed = true; |
| 505 } | 507 } |
| 506 }, | 508 }, |
| 507 }); | 509 }); |
| OLD | NEW |