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({ |