summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/print_preview/preview_generator.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/print_preview/preview_generator.js')
-rw-r--r--chromium/chrome/browser/resources/print_preview/preview_generator.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/chromium/chrome/browser/resources/print_preview/preview_generator.js b/chromium/chrome/browser/resources/print_preview/preview_generator.js
index a26345ca877..bcbe95fe64a 100644
--- a/chromium/chrome/browser/resources/print_preview/preview_generator.js
+++ b/chromium/chrome/browser/resources/print_preview/preview_generator.js
@@ -58,6 +58,13 @@ cr.define('print_preview', function() {
this.inFlightRequestId_ = -1;
/**
+ * Media size to generate preview with. {@code null} indicates default size.
+ * @type {cp.cdd.MediaSizeTicketItem}
+ * @private
+ */
+ this.mediaSize_ = null;
+
+ /**
* Whether the previews are being generated in landscape mode.
* @type {boolean}
* @private
@@ -154,7 +161,8 @@ cr.define('print_preview', function() {
*/
requestPreview: function() {
if (!this.printTicketStore_.isTicketValidForPreview() ||
- !this.printTicketStore_.isInitialized) {
+ !this.printTicketStore_.isInitialized ||
+ !this.destinationStore_.selectedDestination) {
return false;
}
if (!this.hasPreviewChanged_()) {
@@ -163,6 +171,7 @@ cr.define('print_preview', function() {
this.marginsType_ = this.printTicketStore_.marginsType.getValue();
return false;
}
+ this.mediaSize_ = this.printTicketStore_.mediaSize.getValue();
this.isLandscapeEnabled_ = this.printTicketStore_.landscape.getValue();
this.isHeaderFooterEnabled_ =
this.printTicketStore_.headerFooter.getValue();
@@ -262,6 +271,7 @@ cr.define('print_preview', function() {
hasPreviewChanged_: function() {
var ticketStore = this.printTicketStore_;
return this.inFlightRequestId_ == -1 ||
+ !ticketStore.mediaSize.isValueEqual(this.mediaSize_) ||
!ticketStore.landscape.isValueEqual(this.isLandscapeEnabled_) ||
!ticketStore.headerFooter.isValueEqual(this.isHeaderFooterEnabled_) ||
!ticketStore.color.isValueEqual(this.colorValue_) ||