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

Side by Side Diff: chrome/browser/resources/print_preview/native_layer.js

Issue 2606043004: Perform printer setup on Chrome OS before selecting printer. (Closed)
Patch Set: CustomEvent Created 3 years, 11 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 (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
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>}
dpapad 2017/01/12 19:32:50 Can you document the returned object with a typede
skau 2017/01/12 23:24:04 Done.
238 */
239 setupPrinter: function(printerId) {
240 return cr.sendWithPromise('setupPrinter', printerId);
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698