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

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

Issue 1125343004: Add a "Simplify Page" option to the print preview dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify version of the HiddenPrintPreview and solved issues pointed out by the last review Created 5 years, 6 months 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/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index 96336e85c6eddb2790f0b579cd45c2df9f335193..1d8871612046cb827a03a458aeb4060dfa92a27d 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -169,7 +169,8 @@ cr.define('print_preview', function() {
this.printTicketStore_.fitToPage,
this.printTicketStore_.cssBackground,
this.printTicketStore_.selectionOnly,
- this.printTicketStore_.headerFooter);
+ this.printTicketStore_.headerFooter,
+ this.printTicketStore_.printFriendly);
this.addChild(this.otherOptionsSettings_);
/**
@@ -357,6 +358,10 @@ cr.define('print_preview', function() {
this.nativeLayer_,
print_preview.NativeLayer.EventType.MANIPULATE_SETTINGS_FOR_TEST,
this.onManipulateSettingsForTest_.bind(this));
+ this.tracker.add(
+ this.nativeLayer_,
+ print_preview.NativeLayer.EventType.ALLOW_PRINT_FRIENDLY,
+ this.onAllowPrintFriendly_.bind(this));
if ($('system-dialog-link')) {
this.tracker.add(
@@ -641,6 +646,7 @@ cr.define('print_preview', function() {
settings.decimalDelimeter,
settings.unitType,
settings.selectionOnly);
+
this.destinationStore_.init(settings.isInAppKioskMode);
this.appState_.setInitialized();
@@ -1014,6 +1020,15 @@ cr.define('print_preview', function() {
},
/**
+ * Called when the native layer has detected that the "Print friendly"
+ * option should be allowed.
+ * @private
+ */
+ onAllowPrintFriendly_: function(event) {
+ this.printTicketStore_.printFriendly.setIsCapabilityAvailable(true);
+ },
+
+ /**
* Called when the print preview settings need to be changed for testing.
* @param {Event} event Event object that contains the option that is to
* be changed and what to set that option.
@@ -1270,6 +1285,7 @@ cr.define('print_preview', function() {
<include src="data/ticket_items/dpi.js">
<include src="data/ticket_items/duplex.js">
<include src="data/ticket_items/header_footer.js">
+<include src="data/ticket_items/print_friendly.js">
<include src="data/ticket_items/media_size.js">
<include src="data/ticket_items/landscape.js">
<include src="data/ticket_items/margins_type.js">

Powered by Google App Engine
This is Rietveld 408576698