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

Unified Diff: chrome/browser/resources/print_preview/margin_settings.js

Issue 8343017: Print Preview: Hiding margins UI if an error occurs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/preview_area.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/margin_settings.js
diff --git a/chrome/browser/resources/print_preview/margin_settings.js b/chrome/browser/resources/print_preview/margin_settings.js
index 1485e9af6de643dc7b80ff353ba2240a15614e73..ea2ec127727196121f3f3f2b776e5e04f0e39934 100644
--- a/chrome/browser/resources/print_preview/margin_settings.js
+++ b/chrome/browser/resources/print_preview/margin_settings.js
@@ -291,6 +291,19 @@ cr.define('print_preview', function() {
addEventListeners_: function() {
this.marginList_.onchange = this.onMarginsChanged_.bind(this);
document.addEventListener('PDFLoaded', this.onPDFLoaded_.bind(this));
+ document.addEventListener('PDFGenerationError',
+ this.onPDFGenerationError_.bind(this));
+ },
+
+ /**
+ * Executes when an 'PDFGenerationError' event occurs.
+ * @private
+ */
+ onPDFGenerationError_: function() {
+ if (this.isCustomMarginsSelected()) {
+ this.removeCustomMarginEventListeners_();
+ this.marginsUI.hide();
+ }
},
/**
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/preview_area.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698