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 30 matching lines...) Expand all Loading... |
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; |
50 }, | 50 }, |
| 51 |
| 52 /** |
| 53 * @param {string} printerProtocol |
| 54 * @return {string} The Printer's protocol that displays in UI |
| 55 * @private |
| 56 */ |
| 57 getPrinterProtocol_: function(printerProtocol) { |
| 58 if (!printerProtocol) |
| 59 return ''; |
| 60 if (printerProtocol == 'ipp') |
| 61 return loadTimeData.getString('printerProtocolIpp'); |
| 62 if (printerProtocol == 'ipps') |
| 63 return loadTimeData.getString('printerProtocolIpps'); |
| 64 if (printerProtocol == 'http') |
| 65 return loadTimeData.getString('printerProtocolHttp'); |
| 66 if (printerProtocol == 'https') |
| 67 return loadTimeData.getString('printerProtocolHttps'); |
| 68 if (printerProtocol == 'socket') |
| 69 return loadTimeData.getString('printerProtocolAppSocket'); |
| 70 if (printerProtocol == 'lpd') |
| 71 return loadTimeData.getString('printerProtocolLpd'); |
| 72 if (printerProtocol == 'usb') |
| 73 return loadTimeData.getString('printerProtocolUsb'); |
| 74 assertNotReached('Illegal printer protocol!'); |
| 75 }, |
51 }); | 76 }); |
OLD | NEW |