OLD | NEW |
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 /** |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 getCupsPrintersList: function() {}, | 42 getCupsPrintersList: function() {}, |
43 | 43 |
44 /** | 44 /** |
45 * @param {string} printerId | 45 * @param {string} printerId |
46 * @param {string} printerName | 46 * @param {string} printerName |
47 */ | 47 */ |
48 updateCupsPrinter: function(printerId, printerName) {}, | 48 updateCupsPrinter: function(printerId, printerName) {}, |
49 | 49 |
50 /** | 50 /** |
51 * @param {string} printerId | 51 * @param {string} printerId |
| 52 * @param {string} printerName |
52 */ | 53 */ |
53 removeCupsPrinter: function(printerId) {}, | 54 removeCupsPrinter: function(printerId, printerName) {}, |
54 | 55 |
55 /** | 56 /** |
56 * @return {!Promise<string>} The full path of the printer PPD file. | 57 * @return {!Promise<string>} The full path of the printer PPD file. |
57 */ | 58 */ |
58 getCupsPrinterPPDPath: function() {}, | 59 getCupsPrinterPPDPath: function() {}, |
| 60 |
| 61 /** |
| 62 * @param {!CupsPrinterInfo} newPrinter |
| 63 */ |
| 64 addCupsPrinter: function(newPrinter) {}, |
59 }; | 65 }; |
60 | 66 |
61 /** | 67 /** |
62 * @constructor | 68 * @constructor |
63 * @implements {settings.CupsPrintersBrowserProxy} | 69 * @implements {settings.CupsPrintersBrowserProxy} |
64 */ | 70 */ |
65 function CupsPrintersBrowserProxyImpl() {} | 71 function CupsPrintersBrowserProxyImpl() {} |
66 cr.addSingletonGetter(CupsPrintersBrowserProxyImpl); | 72 cr.addSingletonGetter(CupsPrintersBrowserProxyImpl); |
67 | 73 |
68 CupsPrintersBrowserProxyImpl.prototype = { | 74 CupsPrintersBrowserProxyImpl.prototype = { |
69 /** @override */ | 75 /** @override */ |
70 getCupsPrintersList: function() { | 76 getCupsPrintersList: function() { |
71 return cr.sendWithPromise('getCupsPrintersList'); | 77 return cr.sendWithPromise('getCupsPrintersList'); |
72 }, | 78 }, |
73 | 79 |
74 /** @override */ | 80 /** @override */ |
75 updateCupsPrinter: function(printerId, printerName) { | 81 updateCupsPrinter: function(printerId, printerName) { |
76 chrome.send('updateCupsPrinter', [printerId, printerName]); | 82 chrome.send('updateCupsPrinter', [printerId, printerName]); |
77 }, | 83 }, |
78 | 84 |
79 /** @override */ | 85 /** @override */ |
80 removeCupsPrinter: function(printerId) { | 86 removeCupsPrinter: function(printerId, printerName) { |
81 chrome.send('removeCupsPrinter', [printerId]); | 87 chrome.send('removeCupsPrinter', [printerId, printerName]); |
82 }, | 88 }, |
83 | 89 |
84 /** @override */ | 90 /** @override */ |
| 91 addCupsPrinter: function(newPrinter) { |
| 92 chrome.send('addCupsPrinter', [newPrinter]); |
| 93 }, |
| 94 |
| 95 /** @override */ |
85 getCupsPrinterPPDPath: function() { | 96 getCupsPrinterPPDPath: function() { |
86 return cr.sendWithPromise('selectPPDFile'); | 97 return cr.sendWithPromise('selectPPDFile'); |
87 }, | 98 }, |
88 }; | 99 }; |
89 | 100 |
90 return { | 101 return { |
91 CupsPrintersBrowserProxy: CupsPrintersBrowserProxy, | 102 CupsPrintersBrowserProxy: CupsPrintersBrowserProxy, |
92 CupsPrintersBrowserProxyImpl: CupsPrintersBrowserProxyImpl, | 103 CupsPrintersBrowserProxyImpl: CupsPrintersBrowserProxyImpl, |
93 }; | 104 }; |
94 }); | 105 }); |
OLD | NEW |