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

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

Issue 2915703002: Query printers for autoconf info during setup. (Closed)
Patch Set: fix test Created 3 years, 6 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
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 A helper object used from the "CUPS printing" section to 6 * @fileoverview A helper object used from the "CUPS printing" section to
7 * interact with the browser. 7 * interact with the browser.
8 */ 8 */
9 9
10 /** 10 /**
11 * @typedef {{ 11 * @typedef {{
12 * printerAddress: string, 12 * printerAddress: string,
13 * printerAutoconf: boolean,
13 * printerDescription: string, 14 * printerDescription: string,
14 * printerId: string, 15 * printerId: string,
15 * printerManufacturer: string, 16 * printerManufacturer: string,
16 * printerModel: string, 17 * printerModel: string,
17 * printerName: string, 18 * printerName: string,
18 * printerPPDPath: string, 19 * printerPPDPath: string,
19 * printerProtocol: string, 20 * printerProtocol: string,
20 * printerQueue: string, 21 * printerQueue: string,
21 * printerStatus: string 22 * printerStatus: string
22 * }} 23 * }}
(...skipping 16 matching lines...) Expand all
39 var ManufacturersInfo; 40 var ManufacturersInfo;
40 41
41 /** 42 /**
42 * @typedef {{ 43 * @typedef {{
43 * success: boolean, 44 * success: boolean,
44 * models: Array<string> 45 * models: Array<string>
45 * }} 46 * }}
46 */ 47 */
47 var ModelsInfo; 48 var ModelsInfo;
48 49
50 /**
51 * @typedef {{
52 * manufacturer: string,
53 * model: string,
54 * autoconf: boolean
55 * }}
56 */
57 var PrinterMakeModel;
58
59 /**
60 * @typedef {{
61 * message: string
62 * }}
63 */
64 var QueryFailure;
65
49 cr.define('settings', function() { 66 cr.define('settings', function() {
50 /** @interface */ 67 /** @interface */
51 function CupsPrintersBrowserProxy() {} 68 function CupsPrintersBrowserProxy() {}
52 69
53 CupsPrintersBrowserProxy.prototype = { 70 CupsPrintersBrowserProxy.prototype = {
54 71
55 /** 72 /**
56 * @return {!Promise<!CupsPrintersList>} 73 * @return {!Promise<!CupsPrintersList>}
57 */ 74 */
58 getCupsPrintersList: function() {}, 75 getCupsPrintersList: function() {},
(...skipping 27 matching lines...) Expand all
86 /** 103 /**
87 * @return {!Promise<!ManufacturersInfo>} 104 * @return {!Promise<!ManufacturersInfo>}
88 */ 105 */
89 getCupsPrinterManufacturersList: function() {}, 106 getCupsPrinterManufacturersList: function() {},
90 107
91 /** 108 /**
92 * @param {string} manufacturer 109 * @param {string} manufacturer
93 * @return {!Promise<!ModelsInfo>} 110 * @return {!Promise<!ModelsInfo>}
94 */ 111 */
95 getCupsPrinterModelsList: function(manufacturer) {}, 112 getCupsPrinterModelsList: function(manufacturer) {},
113
114 /**
115 * @param {!CupsPrinterInfo} newPrinter
116 * @return {!Promise<!PrinterMakeModel>}
117 */
118 getPrinterInfo: function(newPrinter) {},
96 }; 119 };
97 120
98 /** 121 /**
99 * @constructor 122 * @constructor
100 * @implements {settings.CupsPrintersBrowserProxy} 123 * @implements {settings.CupsPrintersBrowserProxy}
101 */ 124 */
102 function CupsPrintersBrowserProxyImpl() {} 125 function CupsPrintersBrowserProxyImpl() {}
103 cr.addSingletonGetter(CupsPrintersBrowserProxyImpl); 126 cr.addSingletonGetter(CupsPrintersBrowserProxyImpl);
104 127
105 CupsPrintersBrowserProxyImpl.prototype = { 128 CupsPrintersBrowserProxyImpl.prototype = {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 163
141 /** @override */ 164 /** @override */
142 getCupsPrinterManufacturersList: function() { 165 getCupsPrinterManufacturersList: function() {
143 return cr.sendWithPromise('getCupsPrinterManufacturersList'); 166 return cr.sendWithPromise('getCupsPrinterManufacturersList');
144 }, 167 },
145 168
146 /** @override */ 169 /** @override */
147 getCupsPrinterModelsList: function(manufacturer) { 170 getCupsPrinterModelsList: function(manufacturer) {
148 return cr.sendWithPromise('getCupsPrinterModelsList', manufacturer); 171 return cr.sendWithPromise('getCupsPrinterModelsList', manufacturer);
149 }, 172 },
173
174 /** @override */
175 getPrinterInfo: function(newPrinter) {
176 return cr.sendWithPromise('getPrinterInfo', newPrinter);
177 },
150 }; 178 };
151 179
152 return { 180 return {
153 CupsPrintersBrowserProxy: CupsPrintersBrowserProxy, 181 CupsPrintersBrowserProxy: CupsPrintersBrowserProxy,
154 CupsPrintersBrowserProxyImpl: CupsPrintersBrowserProxyImpl, 182 CupsPrintersBrowserProxyImpl: CupsPrintersBrowserProxyImpl,
155 }; 183 };
156 }); 184 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698