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

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

Issue 407733002: [JS Changes] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback (swap checks, update comments) Created 6 years, 1 month 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
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..7e44b9eca8c67eff2b218a9c36c11269160913ea 100644
--- a/chrome/browser/resources/print_preview/native_layer.js
+++ b/chrome/browser/resources/print_preview/native_layer.js
@@ -51,8 +51,6 @@ cr.define('print_preview', function() {
this.onDidGetPreviewPageCount_.bind(this);
global.onDidPreviewPage = this.onDidPreviewPage_.bind(this);
global.updatePrintPreview = this.onUpdatePrintPreview_.bind(this);
- global.printScalingDisabledForSourcePDF =
- this.onPrintScalingDisabledForSourcePDF_.bind(this);
global.onDidGetAccessToken = this.onDidGetAccessToken_.bind(this);
global.autoCancelForTesting = this.autoCancelForTesting_.bind(this);
global.onPrivetPrinterChanged = this.onPrivetPrinterChanged_.bind(this);
@@ -61,6 +59,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 +95,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',
};
/**
@@ -652,15 +653,18 @@ cr.define('print_preview', function() {
},
/**
- * Updates the fit to page option state based on the print scaling option of
- * source pdf. PDF's have an option to enable/disable print scaling. When we
- * find out that the print scaling option is disabled for the source pdf, we
- * uncheck the fitToPage_ to page checkbox. This function is called from C++
- * code.
+ * Update print preset options from source PDF document.
Aleksey Shlyapnikov 2014/11/24 19:47:58 Update -> Updates
Nikhil 2014/11/25 06:36:13 Done.
+ * Called from PrintPreviewUI::OnSetOptionsFromDocument().
+ * @param {{disableScaling: boolean, copies: number}}
Aleksey Shlyapnikov 2014/11/24 19:47:58 Keep more text on this line: * @param {{disab
Nikhil 2014/11/25 06:36:13 Done.
+ * options Specifies printing options according to source
+ * document presets.
* @private
*/
- onPrintScalingDisabledForSourcePDF_: function() {
- cr.dispatchSimpleEvent(this, NativeLayer.EventType.DISABLE_SCALING);
+ onPrintPresetOptionsFromDocument_: function(options) {
+ var printPresetOptionsEvent = new Event(
+ NativeLayer.EventType.PRINT_PRESET_OPTIONS);
+ printPresetOptionsEvent.optionsFromDocument = options;
+ this.dispatchEvent(printPresetOptionsEvent);
},
/**

Powered by Google App Engine
This is Rietveld 408576698