Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2239)

Unified Diff: chrome/browser/resources/settings/printing_page/cups_printer_details_page.js

Issue 2341263003: [CUPS] Fix the Printer protocol string that displays in the UI. (Closed)
Patch Set: Address michaelpg@'s comments. Rebase. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_printer_details_page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/printing_page/cups_printer_details_page.js
diff --git a/chrome/browser/resources/settings/printing_page/cups_printer_details_page.js b/chrome/browser/resources/settings/printing_page/cups_printer_details_page.js
index 931c553fbd4816176a1a5a19ad99b52e41fff33b..c6c9f2edce3ed49f273670eaf15a44d80edc2baf 100644
--- a/chrome/browser/resources/settings/printing_page/cups_printer_details_page.js
+++ b/chrome/browser/resources/settings/printing_page/cups_printer_details_page.js
@@ -48,4 +48,29 @@ Polymer({
return; // Already handled.
this.advancedExpanded = !this.advancedExpanded;
},
+
+ /**
+ * @param {string} printerProtocol
+ * @return {string} The Printer's protocol that displays in UI
+ * @private
+ */
+ getPrinterProtocol_: function(printerProtocol) {
+ if (!printerProtocol)
+ return '';
+ if (printerProtocol == 'ipp')
+ return loadTimeData.getString('printerProtocolIpp');
+ if (printerProtocol == 'ipps')
+ return loadTimeData.getString('printerProtocolIpps');
+ if (printerProtocol == 'http')
+ return loadTimeData.getString('printerProtocolHttp');
+ if (printerProtocol == 'https')
+ return loadTimeData.getString('printerProtocolHttps');
+ if (printerProtocol == 'socket')
+ return loadTimeData.getString('printerProtocolAppSocket');
+ if (printerProtocol == 'lpd')
+ return loadTimeData.getString('printerProtocolLpd');
+ if (printerProtocol == 'usb')
+ return loadTimeData.getString('printerProtocolUsb');
+ assertNotReached('Illegal printer protocol!');
+ },
});
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_printer_details_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698