| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 this.$$('add-printer-dialog').close(); | 158 this.$$('add-printer-dialog').close(); |
| 159 this.fire('open-configuring-printer-dialog'); | 159 this.fire('open-configuring-printer-dialog'); |
| 160 }, | 160 }, |
| 161 | 161 |
| 162 /** @private */ | 162 /** @private */ |
| 163 onAddressChanged_: function() { | 163 onAddressChanged_: function() { |
| 164 // TODO(xdai): Check if the printer address exists and then show the | 164 // TODO(xdai): Check if the printer address exists and then show the |
| 165 // corresponding message after the API is ready. | 165 // corresponding message after the API is ready. |
| 166 // The format of address is: ip-address-or-hostname:port-number. | 166 // The format of address is: ip-address-or-hostname:port-number. |
| 167 }, | 167 }, |
| 168 |
| 169 /** |
| 170 * @param {!Event} event |
| 171 * @private |
| 172 */ |
| 173 onProtocolChange_: function(event) { |
| 174 this.newPrinter.printerProtocol = event.target.value; |
| 175 }, |
| 168 }); | 176 }); |
| 169 | 177 |
| 170 Polymer({ | 178 Polymer({ |
| 171 is: 'add-printer-manufacturer-model-dialog', | 179 is: 'add-printer-manufacturer-model-dialog', |
| 172 | 180 |
| 173 properties: { | 181 properties: { |
| 174 /** @type {!CupsPrinterInfo} */ | 182 /** @type {!CupsPrinterInfo} */ |
| 175 newPrinter: { | 183 newPrinter: { |
| 176 type: Object, | 184 type: Object, |
| 177 notify: true, | 185 notify: true, |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 return; | 465 return; |
| 458 | 466 |
| 459 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { | 467 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { |
| 460 this.setupFailed = true; | 468 this.setupFailed = true; |
| 461 } else if (this.previousDialog_ == AddPrinterDialogs.MANUALLY) { | 469 } else if (this.previousDialog_ == AddPrinterDialogs.MANUALLY) { |
| 462 this.switchDialog_(this.currentDialog_, AddPrinterDialogs.MANUFACTURER, | 470 this.switchDialog_(this.currentDialog_, AddPrinterDialogs.MANUFACTURER, |
| 463 'showManufacturerDialog_'); | 471 'showManufacturerDialog_'); |
| 464 } | 472 } |
| 465 }, | 473 }, |
| 466 }); | 474 }); |
| OLD | NEW |