| 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-printer-details-page' is the subpage for | 6 * @fileoverview 'settings-cups-printer-details-page' is the subpage for |
| 7 * viewing the details of a CUPS printer. | 7 * viewing the details of a CUPS printer. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-cups-printer-details-page', | 10 is: 'settings-cups-printer-details-page', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 /** @override */ | 28 /** @override */ |
| 29 created: function() { | 29 created: function() { |
| 30 this.browserProxy_ = settings.CupsPrintersBrowserProxyImpl.getInstance(); | 30 this.browserProxy_ = settings.CupsPrintersBrowserProxyImpl.getInstance(); |
| 31 }, | 31 }, |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * Event triggered when the input value changes. | 34 * Event triggered when the input value changes. |
| 35 * @private | 35 * @private |
| 36 */ | 36 */ |
| 37 onValueChange_: function() { | 37 onValueChange_: function() { |
| 38 this.browserProxy_.updateCupsPrinter(this.printer.printerId, | 38 this.browserProxy_.updateCupsPrinter( |
| 39 this.printer.printerName); | 39 this.printer.printerId, this.printer.printerName); |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * @param {Event} event | 43 * @param {Event} event |
| 44 * @private | 44 * @private |
| 45 */ | 45 */ |
| 46 toggleAdvancedExpanded_: function(event) { | 46 toggleAdvancedExpanded_: function(event) { |
| 47 if (event.target.id == 'expandButton') | 47 if (event.target.id == 'expandButton') |
| 48 return; // Already handled. | 48 return; // Already handled. |
| 49 this.advancedExpanded = !this.advancedExpanded; | 49 this.advancedExpanded = !this.advancedExpanded; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 75 }, | 75 }, |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * @param {!CupsPrinterInfo} printer | 78 * @param {!CupsPrinterInfo} printer |
| 79 * @return {string} The printer's URI that displays in the UI | 79 * @return {string} The printer's URI that displays in the UI |
| 80 * @private | 80 * @private |
| 81 */ | 81 */ |
| 82 getPrinterURI_: function(printer) { | 82 getPrinterURI_: function(printer) { |
| 83 if (!printer) { | 83 if (!printer) { |
| 84 return ''; | 84 return ''; |
| 85 } else if (printer.printerProtocol && | 85 } else if ( |
| 86 printer.printerAddress && | 86 printer.printerProtocol && printer.printerAddress && |
| 87 printer.printerQueue) { | 87 printer.printerQueue) { |
| 88 return printer.printerProtocol + '://' + | 88 return printer.printerProtocol + '://' + printer.printerAddress + '/' + |
| 89 printer.printerAddress + '/' + | 89 printer.printerQueue; |
| 90 printer.printerQueue; | |
| 91 } else if (printer.printerProtocol && printer.printerAddress) { | 90 } else if (printer.printerProtocol && printer.printerAddress) { |
| 92 return printer.printerProtocol + '://' + printer.printerAddress; | 91 return printer.printerProtocol + '://' + printer.printerAddress; |
| 93 } else { | 92 } else { |
| 94 return ''; | 93 return ''; |
| 95 } | 94 } |
| 96 }, | 95 }, |
| 97 }); | 96 }); |
| OLD | NEW |