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

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

Issue 2848093002: Process null capabilities as a capability fetch failure. (Closed)
Patch Set: 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
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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 this.dispatchEvent(localDestsSetEvent); 543 this.dispatchEvent(localDestsSetEvent);
544 }, 544 },
545 545
546 /** 546 /**
547 * Called when native layer gets settings information for a requested local 547 * Called when native layer gets settings information for a requested local
548 * destination. 548 * destination.
549 * @param {Object} settingsInfo printer setting information. 549 * @param {Object} settingsInfo printer setting information.
550 * @private 550 * @private
551 */ 551 */
552 onUpdateWithPrinterCapabilities_: function(settingsInfo) { 552 onUpdateWithPrinterCapabilities_: function(settingsInfo) {
553 if (settingsInfo.capabilities == null) {
dpapad 2017/05/01 17:39:28 Why are we doing this in Javascript instead of C++
skau 2017/05/01 22:51:26 It crept up as a bug. The code you referenced onl
554 this.onFailedToGetPrinterCapabilities_(settingsInfo['printerId']);
555 return;
556 }
557
553 var capsSetEvent = new Event(NativeLayer.EventType.CAPABILITIES_SET); 558 var capsSetEvent = new Event(NativeLayer.EventType.CAPABILITIES_SET);
554 capsSetEvent.settingsInfo = settingsInfo; 559 capsSetEvent.settingsInfo = settingsInfo;
555 this.dispatchEvent(capsSetEvent); 560 this.dispatchEvent(capsSetEvent);
556 }, 561 },
557 562
558 /** 563 /**
559 * Called when native layer gets settings information for a requested local 564 * Called when native layer gets settings information for a requested local
560 * destination. 565 * destination.
561 * @param {string} destinationId Printer affected by error. 566 * @param {string} destinationId Printer affected by error.
562 * @private 567 * @private
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 return this.serializedDefaultDestinationSelectionRulesStr_; 1109 return this.serializedDefaultDestinationSelectionRulesStr_;
1105 } 1110 }
1106 }; 1111 };
1107 1112
1108 // Export 1113 // Export
1109 return { 1114 return {
1110 NativeInitialSettings: NativeInitialSettings, 1115 NativeInitialSettings: NativeInitialSettings,
1111 NativeLayer: NativeLayer 1116 NativeLayer: NativeLayer
1112 }; 1117 };
1113 }); 1118 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698