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 673b8d89ef191a18ce356069d2512ed1080f5780..68ac675db0055eb6dae9a08d4fac104e4f7511a9 100644 |
--- a/chrome/browser/resources/print_preview/print_preview.js |
+++ b/chrome/browser/resources/print_preview/print_preview.js |
@@ -351,6 +351,10 @@ cr.define('print_preview', function() { |
this.onDisableScaling_.bind(this)); |
this.tracker.add( |
this.nativeLayer_, |
+ print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS, |
+ this.onPrintPresetOptionsFromDocument_.bind(this)); |
+ this.tracker.add( |
+ this.nativeLayer_, |
print_preview.NativeLayer.EventType.PRIVET_PRINT_FAILED, |
this.onPrivetPrintFailed_.bind(this)); |
this.tracker.add( |
@@ -989,6 +993,24 @@ cr.define('print_preview', function() { |
}, |
/** |
+ * Called when the native layer dispatches a PRINT_PRESET_OPTIONS event. It |
+ * updates the print preset options from source document. |
+ * @param {event} event Contains options from source document. |
+ * @private |
+ */ |
+ onPrintPresetOptionsFromDocument_: function(event) { |
+ if (event.optionsFromDocument.fitToPageEnabled) { |
+ this.printTicketStore_.fitToPage.updateValue(null); |
+ this.documentInfo_.updateIsScalingDisabled(true); |
+ } |
+ |
+ if (event.optionsFromDocument.copies) { |
Aleksey Shlyapnikov
2014/11/20 18:56:56
Check this.printTicketStore_.copies.isCapabilityAv
Nikhil
2014/11/21 10:45:32
NumCopies property spec doesn't say anything speci
Aleksey Shlyapnikov
2014/11/21 22:50:41
I agree and that's why I suggested to add this.pri
|
+ this.printTicketStore_.copies.updateValue( |
+ event.optionsFromDocument.copies); |
Aleksey Shlyapnikov
2014/11/20 18:56:56
Two more spaces indent.
Nikhil
2014/11/21 10:45:32
Done.
|
+ } |
+ }, |
+ |
+ /** |
* Called when privet printing fails. |
* @param {Event} event Event object representing the failure. |
* @private |