Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.exportPath('print_preview'); | 5 cr.exportPath('print_preview'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @typedef {{selectSaveAsPdfDestination: boolean, | 8 * @typedef {{selectSaveAsPdfDestination: boolean, |
| 9 * layoutSettings.portrait: boolean, | 9 * layoutSettings.portrait: boolean, |
| 10 * pageRange: string, | 10 * pageRange: string, |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 * the resolved destination properties by calling | 225 * the resolved destination properties by calling |
| 226 * {@code onProvisionalPrinterResolved}, or in case of an error | 226 * {@code onProvisionalPrinterResolved}, or in case of an error |
| 227 * {@code failedToResolveProvisionalPrinter} | 227 * {@code failedToResolveProvisionalPrinter} |
| 228 * @param {string} provisionalDestinationId | 228 * @param {string} provisionalDestinationId |
| 229 */ | 229 */ |
| 230 grantExtensionPrinterAccess: function(provisionalDestinationId) { | 230 grantExtensionPrinterAccess: function(provisionalDestinationId) { |
| 231 chrome.send('grantExtensionPrinterAccess', [provisionalDestinationId]); | 231 chrome.send('grantExtensionPrinterAccess', [provisionalDestinationId]); |
| 232 }, | 232 }, |
| 233 | 233 |
| 234 /** | 234 /** |
| 235 * Requests that Chrome peform printer setup for the given printer. | |
| 236 * @param {string} printerId | |
| 237 * @return {!Promise<Object>} | |
| 238 */ | |
| 239 setupPrinter: function(printerId) { | |
| 240 return cr.sendWithPromise('setupPrinter', [printerId]); | |
|
dpapad
2017/01/12 01:18:10
Why do you need to wrap |printerId| in an array? S
skau
2017/01/12 02:17:17
I've unwrapped it. Send needed it to be wrapped.
| |
| 241 }, | |
| 242 | |
| 243 /** | |
| 235 * @param {!print_preview.Destination} destination Destination to print to. | 244 * @param {!print_preview.Destination} destination Destination to print to. |
| 236 * @param {!print_preview.ticket_items.Color} color Color ticket item. | 245 * @param {!print_preview.ticket_items.Color} color Color ticket item. |
| 237 * @return {number} Native layer color model. | 246 * @return {number} Native layer color model. |
| 238 * @private | 247 * @private |
| 239 */ | 248 */ |
| 240 getNativeColorModel_: function(destination, color) { | 249 getNativeColorModel_: function(destination, color) { |
| 241 // For non-local printers native color model is ignored anyway. | 250 // For non-local printers native color model is ignored anyway. |
| 242 var option = destination.isLocal ? color.getSelectedOption() : null; | 251 var option = destination.isLocal ? color.getSelectedOption() : null; |
| 243 var nativeColorModel = parseInt(option ? option.vendor_id : null, 10); | 252 var nativeColorModel = parseInt(option ? option.vendor_id : null, 10); |
| 244 if (isNaN(nativeColorModel)) { | 253 if (isNaN(nativeColorModel)) { |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1095 return this.serializedDefaultDestinationSelectionRulesStr_; | 1104 return this.serializedDefaultDestinationSelectionRulesStr_; |
| 1096 } | 1105 } |
| 1097 }; | 1106 }; |
| 1098 | 1107 |
| 1099 // Export | 1108 // Export |
| 1100 return { | 1109 return { |
| 1101 NativeInitialSettings: NativeInitialSettings, | 1110 NativeInitialSettings: NativeInitialSettings, |
| 1102 NativeLayer: NativeLayer | 1111 NativeLayer: NativeLayer |
| 1103 }; | 1112 }; |
| 1104 }); | 1113 }); |
| OLD | NEW |