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 673b8d89ef191a18ce356069d2512ed1080f5780..c3ea3fb349509c9fb5fd8abbf40d591fb403d6f6 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)); |
|
Aleksey Shlyapnikov
2014/11/21 22:50:42
Please remove _all_ obsolete code.
Nikhil
2014/11/24 12:57:30
Done.
|
| 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,23 @@ cr.define('print_preview', function() { |
| }, |
|
Aleksey Shlyapnikov
2014/11/21 22:50:42
Please remove _all_ obsolete code.
Nikhil
2014/11/24 12:57:30
Done.
|
| /** |
| + * Called when the native layer dispatches a PRINT_PRESET_OPTIONS event. It |
| + * updates the print preset options from source document. |
|
Aleksey Shlyapnikov
2014/11/21 22:50:42
Just one sentence:
Updates printing options accor
Nikhil
2014/11/24 12:57:30
Done.
|
| + * @param {event} event Contains options from source document. |
|
Aleksey Shlyapnikov
2014/11/21 22:50:42
event -> Event
Nikhil
2014/11/24 12:57:30
Done.
|
| + * @private |
| + */ |
| + onPrintPresetOptionsFromDocument_: function(event) { |
| + if (event.optionsFromDocument.disableScaling) |
| + this.onDisableScaling_(); |
| + |
| + if (this.printTicketStore_.copies.isCapabilityAvailable() && |
| + event.optionsFromDocument.copies) { |
|
Aleksey Shlyapnikov
2014/11/21 22:50:42
Let's swap checks and add sanity check:
if (event
Nikhil
2014/11/24 12:57:30
Done.
|
| + this.printTicketStore_.copies.updateValue( |
| + event.optionsFromDocument.copies); |
| + } |
| + }, |
| + |
| + /** |
| * Called when privet printing fails. |
| * @param {Event} event Event object representing the failure. |
| * @private |