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

Side by Side Diff: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js

Issue 2860883004: [CUPS] Fix the issue the default queue value not being persisted with each new printer setup. (Closed)
Patch Set: Address michaelpg@'s comment. Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-add-printer-dialog' includes multiple dialogs to 6 * @fileoverview 'settings-cups-add-printer-dialog' includes multiple dialogs to
7 * set up a new CUPS printer. 7 * set up a new CUPS printer.
8 * Subdialogs include: 8 * Subdialogs include:
9 * - 'add-printer-discovery-dialog' is a dialog showing discovered printers on 9 * - 'add-printer-discovery-dialog' is a dialog showing discovered printers on
10 * the network that are available for setup. 10 * the network that are available for setup.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 value: function() { 128 value: function() {
129 return { 129 return {
130 printerAddress: '', 130 printerAddress: '',
131 printerDescription: '', 131 printerDescription: '',
132 printerId: '', 132 printerId: '',
133 printerManufacturer: '', 133 printerManufacturer: '',
134 printerModel: '', 134 printerModel: '',
135 printerName: '', 135 printerName: '',
136 printerPPDPath: '', 136 printerPPDPath: '',
137 printerProtocol: 'ipp', 137 printerProtocol: 'ipp',
138 printerQueue: 'ipp/print', 138 printerQueue: '',
139 printerStatus: '', 139 printerStatus: '',
140 }; 140 };
141 }, 141 },
142 }, 142 },
143 }, 143 },
144 144
145 /** @private */ 145 /** @private */
146 switchToDiscoveryDialog_: function() { 146 switchToDiscoveryDialog_: function() {
147 this.$$('add-printer-dialog').close(); 147 this.$$('add-printer-dialog').close();
148 this.fire('open-discovery-printers-dialog'); 148 this.fire('open-discovery-printers-dialog');
149 }, 149 },
150 150
151 /** @private */ 151 /** @private */
152 onCancelTap_: function() { 152 onCancelTap_: function() {
153 this.$$('add-printer-dialog').close(); 153 this.$$('add-printer-dialog').close();
154 }, 154 },
155 155
156 /** @private */ 156 /** @private */
157 switchToManufacturerDialog_: function() { 157 switchToManufacturerDialog_: function() {
158 // Set the default printer queue to be "ipp/print".
159 if (!this.newPrinter.printerQueue)
160 this.set('newPrinter.printerQueue', 'ipp/print');
161
158 this.$$('add-printer-dialog').close(); 162 this.$$('add-printer-dialog').close();
159 this.fire('open-manufacturer-model-dialog'); 163 this.fire('open-manufacturer-model-dialog');
160 }, 164 },
161 165
162 /** @private */ 166 /** @private */
163 onAddressChanged_: function() { 167 onAddressChanged_: function() {
164 // TODO(xdai): Check if the printer address exists and then show the 168 // TODO(xdai): Check if the printer address exists and then show the
165 // corresponding message after the API is ready. 169 // corresponding message after the API is ready.
166 // The format of address is: ip-address-or-hostname:port-number. 170 // The format of address is: ip-address-or-hostname:port-number.
167 }, 171 },
168 172
169 /** 173 /**
170 * @param {!Event} event 174 * @param {!Event} event
171 * @private 175 * @private
172 */ 176 */
173 onProtocolChange_: function(event) { 177 onProtocolChange_: function(event) {
174 this.newPrinter.printerProtocol = event.target.value; 178 this.set('newPrinter.printerProtocol', event.target.value);
175 }, 179 },
176 }); 180 });
177 181
178 Polymer({ 182 Polymer({
179 is: 'add-printer-manufacturer-model-dialog', 183 is: 'add-printer-manufacturer-model-dialog',
180 184
181 properties: { 185 properties: {
182 /** @type {!CupsPrinterInfo} */ 186 /** @type {!CupsPrinterInfo} */
183 newPrinter: { 187 newPrinter: {
184 type: Object, 188 type: Object,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 onBrowseFile_: function() { 233 onBrowseFile_: function() {
230 settings.CupsPrintersBrowserProxyImpl.getInstance(). 234 settings.CupsPrintersBrowserProxyImpl.getInstance().
231 getCupsPrinterPPDPath().then(this.printerPPDPathChanged_.bind(this)); 235 getCupsPrinterPPDPath().then(this.printerPPDPathChanged_.bind(this));
232 }, 236 },
233 237
234 /** 238 /**
235 * @param {string} path 239 * @param {string} path
236 * @private 240 * @private
237 */ 241 */
238 printerPPDPathChanged_: function(path) { 242 printerPPDPathChanged_: function(path) {
239 this.newPrinter.printerPPDPath = path; 243 this.set('newPrinter.printerPPDPath', path);
240 this.$$('paper-input').value = this.getBaseName_(path); 244 this.$$('paper-input').value = this.getBaseName_(path);
241 }, 245 },
242 246
243 /** 247 /**
244 * @param {!ManufacturersInfo} manufacturersInfo 248 * @param {!ManufacturersInfo} manufacturersInfo
245 * @private 249 * @private
246 */ 250 */
247 manufacturerListChanged_: function(manufacturersInfo) { 251 manufacturerListChanged_: function(manufacturersInfo) {
248 if (manufacturersInfo.success) 252 if (manufacturersInfo.success)
249 this.manufacturerList = manufacturersInfo.manufacturers; 253 this.manufacturerList = manufacturersInfo.manufacturers;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 onAddPrinter_: function(success, printerName) { 498 onAddPrinter_: function(success, printerName) {
495 this.$$('add-printer-configuring-dialog').close(); 499 this.$$('add-printer-configuring-dialog').close();
496 if (success) 500 if (success)
497 return; 501 return;
498 502
499 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { 503 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) {
500 this.setupFailed = true; 504 this.setupFailed = true;
501 } 505 }
502 }, 506 },
503 }); 507 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698