Index: chrome/browser/resources/print_preview/native_layer.js |
diff --git a/chrome/browser/resources/print_preview/native_layer.js b/chrome/browser/resources/print_preview/native_layer.js |
index ca7ff32c84fe2e115cbd8bd8a417a0213812dacd..db1cfc0dd640090056673b544c02b4abc59ac3b3 100644 |
--- a/chrome/browser/resources/print_preview/native_layer.js |
+++ b/chrome/browser/resources/print_preview/native_layer.js |
@@ -61,6 +61,8 @@ cr.define('print_preview', function() { |
global.onPrivetPrintFailed = this.onPrivetPrintFailed_.bind(this); |
global.onEnableManipulateSettingsForTest = |
this.onEnableManipulateSettingsForTest_.bind(this); |
+ global.printPresetOptionsFromDocument = |
+ this.onPrintPresetOptionsFromDocument_.bind(this); |
}; |
/** |
@@ -95,6 +97,7 @@ cr.define('print_preview', function() { |
PRIVET_CAPABILITIES_SET: |
'print_preview.NativeLayer.PRIVET_CAPABILITIES_SET', |
PRIVET_PRINT_FAILED: 'print_preview.NativeLayer.PRIVET_PRINT_FAILED', |
+ PRINT_PRESET_OPTIONS: 'print_preview.NativeLayer.PRINT_PRESET_OPTIONS', |
}; |
/** |
@@ -664,6 +667,20 @@ cr.define('print_preview', function() { |
}, |
/** |
+ * Update print preset options from source PDF document. |
+ * Called from PrintPreviewUI::OnSetOptionsFromDocument(). |
+ * @param {object} options Print preset options as mentioned in source |
+ * document. |
+ * @private |
+ */ |
+ onPrintPresetOptionsFromDocument_: function(options) { |
+ var printPresetOptionsEvent = new Event( |
+ NativeLayer.EventType.PRINT_PRESET_OPTIONS); |
+ printPresetOptionsEvent.optionsFromDocument = options; |
+ this.dispatchEvent(printPresetOptionsEvent); |
+ }, |
+ |
+ /** |
* Simulates a user click on the print preview dialog cancel button. Used |
* only for testing. |
* @private |