Chromium Code Reviews| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 value: function() { | 128 value: function() { |
| 129 return { | 129 return { |
| 130 printerAddress: '', | 130 printerAddress: '', |
| 131 printerDescription: '', | 131 printerDescription: '', |
| 132 printerId: '', | 132 printerId: '', |
| 133 printerManufacturer: '', | 133 printerManufacturer: '', |
| 134 printerModel: '', | 134 printerModel: '', |
| 135 printerName: '', | 135 printerName: '', |
| 136 printerPPDPath: '', | 136 printerPPDPath: '', |
| 137 printerProtocol: 'ipp', | 137 printerProtocol: 'ipp', |
| 138 printerQueue: 'ipp/print', | 138 printerQueue: '', |
| 139 printerStatus: '', | 139 printerStatus: '', |
| 140 }; | 140 }; |
| 141 }, | 141 }, |
| 142 }, | 142 }, |
| 143 }, | 143 }, |
| 144 | 144 |
| 145 /** @private */ | 145 /** @private */ |
| 146 switchToDiscoveryDialog_: function() { | 146 switchToDiscoveryDialog_: function() { |
| 147 this.$$('add-printer-dialog').close(); | 147 this.$$('add-printer-dialog').close(); |
| 148 this.fire('open-discovery-printers-dialog'); | 148 this.fire('open-discovery-printers-dialog'); |
| 149 }, | 149 }, |
| 150 | 150 |
| 151 /** @private */ | 151 /** @private */ |
| 152 onCancelTap_: function() { | 152 onCancelTap_: function() { |
| 153 this.$$('add-printer-dialog').close(); | 153 this.$$('add-printer-dialog').close(); |
| 154 }, | 154 }, |
| 155 | 155 |
| 156 /** @private */ | 156 /** @private */ |
| 157 switchToManufacturerDialog_: function() { | 157 switchToManufacturerDialog_: function() { |
| 158 // Set the default printer queue to be "ipp/print". | |
| 159 if (!this.newPrinter.printerQueue) | |
| 160 this.newPrinter.printerQueue = "ipp/print"; | |
|
michaelpg
2017/05/04 22:30:10
here and elsewhere, why does this work? Normally P
xdai1
2017/05/05 00:45:37
I think the root reason is it means I don't fully
michaelpg
2017/05/05 19:10:46
It's black magic, none of us do :-)
But generally
michaelpg
2017/05/05 20:45:49
Replying to your message:
| |
| 161 | |
| 158 this.$$('add-printer-dialog').close(); | 162 this.$$('add-printer-dialog').close(); |
| 159 this.fire('open-manufacturer-model-dialog'); | 163 this.fire('open-manufacturer-model-dialog'); |
| 160 }, | 164 }, |
| 161 | 165 |
| 162 /** @private */ | 166 /** @private */ |
| 163 onAddressChanged_: function() { | 167 onAddressChanged_: function() { |
| 164 // TODO(xdai): Check if the printer address exists and then show the | 168 // TODO(xdai): Check if the printer address exists and then show the |
| 165 // corresponding message after the API is ready. | 169 // corresponding message after the API is ready. |
| 166 // The format of address is: ip-address-or-hostname:port-number. | 170 // The format of address is: ip-address-or-hostname:port-number. |
| 167 }, | 171 }, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 494 onAddPrinter_: function(success, printerName) { | 498 onAddPrinter_: function(success, printerName) { |
| 495 this.$$('add-printer-configuring-dialog').close(); | 499 this.$$('add-printer-configuring-dialog').close(); |
| 496 if (success) | 500 if (success) |
| 497 return; | 501 return; |
| 498 | 502 |
| 499 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { | 503 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { |
| 500 this.setupFailed = true; | 504 this.setupFailed = true; |
| 501 } | 505 } |
| 502 }, | 506 }, |
| 503 }); | 507 }); |
| OLD | NEW |