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

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

Issue 2825153002: Update CUPS settings UI to allow USB printers to be added via discovery. (Closed)
Patch Set: Created 3 years, 8 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 d97e93bd526bea01795afe316b1875f942fcf82c..e3d49da1d3176b1b2937a921c8491b8fea4fd631 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
@@ -50,6 +50,12 @@ Polymer({
notify: true,
},
+ /** @type {!CupsPrinterInfo} */
+ newPrinter: {
+ type: Object,
+ notify: true,
xdai1 2017/04/24 21:42:12 I think put the new property newPrinter in manufac
Carlson 2017/05/01 20:59:49 Sorry, I don't really understand what you mean by
xdai1 2017/05/02 17:25:08 Sorry I didn't explain it in a clear way. I under
+ },
+
discovering_: {
type: Boolean,
value: true,
@@ -110,10 +116,25 @@ Polymer({
},
/** @private */
- switchToConfiguringDialog_: function() {
+ switchToManufacturerDialog_: function() {
this.stopDiscoveringPrinters_();
+
+ // Copy relevant fields over from selected printer,
+ // clear the rest.
+ this.newPrinter = {
+ printerAddress: this.selectedPrinter.printerAddress,
+ printerDescription: this.selectedPrinter.printerDescription,
+ printerId: this.selectedPrinter.printerId,
+ printerName: this.selectedPrinter.printerName,
+ printerProtocol: this.selectedPrinter.printerProtocol,
+ printerQueue: this.selectedPrinter.printerQueue,
+ printerStatus: this.selectedPrinter.printerStatus,
+ printerManufacturer: '',
+ printerModel: '',
+ printerPPDPath: '',
+ };
this.$$('add-printer-dialog').close();
- this.fire('open-configuring-printer-dialog');
+ this.fire('open-manufacturer-model-dialog');
},
});
@@ -332,6 +353,13 @@ Polymer({
value: false,
},
+ /** @type {boolean} whether we're doing manufacturer/model in
+ a manual flow (as opposed to a discovery flow). */
xdai1 2017/04/24 21:42:12 The format should be /** * @type {boolean} commen
Carlson 2017/05/01 20:59:49 done.
+ inManualFlow: {
xdai1 2017/04/24 21:42:12 this should be a private property.
Carlson 2017/05/01 20:59:49 Done.
+ type: Boolean,
+ value: false,
+ },
+
configuringDialogTitle: String,
/** @private {string} */
@@ -369,8 +397,7 @@ Polymer({
/** Opens the Add printer discovery dialog. */
open: function() {
this.resetData_();
- this.switchDialog_(
- '', AddPrinterDialogs.MANUALLY, 'showManuallyAddDialog_');
+ this.switchDialog_('', AddPrinterDialogs.DISCOVERY, 'showDiscoveryDialog_');
},
/**
@@ -438,6 +465,7 @@ Polymer({
openManufacturerModelDialog_: function() {
this.switchDialog_(this.currentDialog_, AddPrinterDialogs.MANUFACTURER,
'showManufacturerDialog_');
+ this.inManualFlow = (this.previousDialog_ == AddPrinterDialogs.MANUALLY);
},
/** @private */

Powered by Google App Engine
This is Rietveld 408576698