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 5b8e91413bb405a6088ef73f0e6e15e2f02518be..8397e18a1aea00ee49b81d5593eef3f52164b3f7 100644 |
--- a/chrome/browser/resources/print_preview/print_preview.js |
+++ b/chrome/browser/resources/print_preview/print_preview.js |
@@ -262,6 +262,11 @@ cr.define('print_preview', function() { |
this.nativeLayer_, |
print_preview.NativeLayer.EventType.DISABLE_SCALING, |
this.onDisableScaling_.bind(this)); |
+ this.tracker.add( |
+ this.nativeLayer_, |
+ print_preview.NativeLayer.EventType.PRIVET_PRINT_FAILED, |
+ this.onPrivetPrintFailed_.bind(this)); |
+ |
this.tracker.add( |
$('system-dialog-link'), |
@@ -408,6 +413,7 @@ cr.define('print_preview', function() { |
this.setIsEnabled_(false); |
if (this.printIfReady_() && |
((this.destinationStore_.selectedDestination.isLocal && |
+ !this.destinationStore_.selectedDestination.isPrivet && |
this.destinationStore_.selectedDestination.id != |
print_preview.Destination.GooglePromotedId.SAVE_AS_PDF) || |
this.uiState_ == PrintPreview.UiState_.OPENING_PDF_PREVIEW)) { |
@@ -804,6 +810,18 @@ cr.define('print_preview', function() { |
}, |
/** |
+ * Called when privet printing fails. |
+ * @param {Event} event Event object representing the failure. |
+ * @private |
+ */ |
+ onPrivetPrintFailed_: function(event) { |
+ console.error('Privet printing failed with error code ' + |
+ event.httpError); |
+ this.close_(); |
Toscano
2013/11/06 22:05:35
Instead of closing, wouldn't you rather show an er
Noam Samuel
2013/11/06 23:59:11
Done.
|
+ }, |
+ |
Toscano
2013/11/06 22:05:35
Please remove extraneous newline.
Noam Samuel
2013/11/06 23:59:11
Done.
|
+ |
+ /** |
* Called when the open-cloud-print-dialog link is clicked. Opens the Google |
* Cloud Print web dialog. |
* @private |