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 == 'ipp') | |
michaelpg
2016/09/17 02:19:06
Optional: name the strings "printerProtocol_ipp",
xdai1
2016/09/19 22:43:48
Renaming it to "printerProtocol_ipp" seems break t
michaelpg
2016/09/19 23:32:08
That's fine, I just mentioned it as an option. (St
| |
59 return loadTimeData.getString('printerProtocolIpp'); | |
60 if (printerProtocol == 'ipps') | |
61 return loadTimeData.getString('printerProtocolIpps'); | |
62 if (printerProtocol == 'http') | |
63 return loadTimeData.getString('printerProtocolHttp'); | |
64 if (printerProtocol == 'https') | |
65 return loadTimeData.getString('printerProtocolHttps'); | |
66 if (printerProtocol == 'socket') | |
67 return loadTimeData.getString('printerProtocolAppSocket'); | |
68 if (printerProtocol == 'lpd') | |
69 return loadTimeData.getString('printerProtocolLpd'); | |
70 if (printerProtocol == 'usb') | |
71 return loadTimeData.getString('printerProtocolUsb'); | |
72 return ''; | |
michaelpg
2016/09/17 02:19:06
if the printer protocol should always be one of th
xdai1
2016/09/19 22:43:48
Addressed! Yes, the protocol should only be one of
| |
73 }, | |
51 }); | 74 }); |
OLD | NEW |