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

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

Issue 2332483002: [CUPS] Implement the CUPS printer PPD file picker in the manufacturer and model dialog. (Closed)
Patch Set: 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
Index: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
diff --git a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
index b8dc24498eb27f9aa1ed0bdceab67cbd6de089fa..a390c4791a07d22f2aabd98273b499b127640e94 100644
--- a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
+++ b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
@@ -84,6 +84,7 @@ Polymer({
printerProtocol: 'ipp',
printerQueue: '',
printerStatus: '',
+ printerPPDPath: '',
michaelpg 2016/09/15 03:01:39 nit: keep alphabetized?
xdai1 2016/09/16 21:19:31 Done.
};
},
},
@@ -187,6 +188,21 @@ Polymer({
},
/** @private */
+ onBrowseFile_: function() {
+ settings.CupsPrintersBrowserProxyImpl.getInstance().
+ getCupsPrinterPPDPath().then(this.printerPPDPathChanged_.bind(this));
+ },
+
+ /**
+ * @param {string} path
+ * @private
+ */
+ printerPPDPathChanged_: function(path) {
+ this.newPrinter.printerPPDPath = path;
+ this.$$('paper-input').value = this.getBaseName_(path);
+ },
+
+ /** @private */
switchToManualAddDialog_: function() {
this.$$('add-printer-dialog').close();
this.fire('open-manually-add-printer-dialog');
@@ -202,6 +218,15 @@ Polymer({
this.$$('add-printer-dialog').close();
this.fire('open-configuring-printer-dialog');
},
+
+ /**
+ * @param {string} path The full path of the file
+ * @return {string} The base name of the file
+ * @private
+ */
+ getBaseName_: function(path) {
+ return path.substring(path.lastIndexOf('/') + 1);
+ },
});
Polymer({

Powered by Google App Engine
This is Rietveld 408576698