Chromium Code Reviews| Index: chrome/browser/resources/print_preview/print_preview.js |
| diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js |
| index 149d93a3288db60959756e1414f48eddc9bb6e0a..ad9822b37f3a5c7ad12aef60c39cd15ddcafdee7 100644 |
| --- a/chrome/browser/resources/print_preview/print_preview.js |
| +++ b/chrome/browser/resources/print_preview/print_preview.js |
| @@ -341,6 +341,8 @@ cr.define('print_preview', function() { |
| this.onInitialSettingsSet_.bind(this)); |
| print_preview.PrintPreviewFocusManager.getInstance().initialize(); |
| cr.ui.FocusOutlineManager.forDocument(document); |
| + cr.addWebUIListener('print-failed', |
|
dpapad
2017/06/14 20:52:45
I think that we need to remove this listener in ex
rbpotter
2017/06/14 22:52:55
Done.
|
| + this.onPrintFailed_.bind(this)); |
| }, |
| /** @override */ |
| @@ -375,10 +377,6 @@ cr.define('print_preview', function() { |
| nativeLayerEventTarget, |
| print_preview.NativeLayer.EventType.PAGE_COUNT_READY, |
| this.onPageCountReady_.bind(this)); |
| - this.tracker.add( |
| - nativeLayerEventTarget, |
| - print_preview.NativeLayer.EventType.PRIVET_PRINT_FAILED, |
| - this.onPrivetPrintFailed_.bind(this)); |
| this.tracker.add( |
| nativeLayerEventTarget, |
| print_preview.NativeLayer.EventType.MANIPULATE_SETTINGS_FOR_TEST, |
| @@ -1033,13 +1031,13 @@ cr.define('print_preview', function() { |
| }, |
| /** |
| - * Called when privet printing fails. |
| - * @param {Event} event Event object representing the failure. |
| + * Called when printing to a privet or extension printer fails. |
| + * @param {number | string} httpError The HTTP error code, or -1 if not an |
| + * HTTP error. |
| * @private |
| */ |
| - onPrivetPrintFailed_: function(event) { |
| - console.error('Privet printing failed with error code ' + |
| - event.httpError); |
| + onPrintFailed_: function(httpError) { |
| + console.error('Privet printing failed with error code ' + httpError); |
| this.printHeader_.setErrorMessage( |
| loadTimeData.getString('couldNotPrint')); |
| }, |