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

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

Issue 2524143003: Print Preview: Add option to rasterize PDFs and add JPEG compression. (Closed)
Patch Set: Add flag Created 4 years 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/settings/other_options_settings.js
diff --git a/chrome/browser/resources/print_preview/settings/other_options_settings.js b/chrome/browser/resources/print_preview/settings/other_options_settings.js
index 06a2991d5e62d4ce66000f98428148feacbf5dbe..ee5ff0add6f6ccc2884aaf90394c647107129714 100644
--- a/chrome/browser/resources/print_preview/settings/other_options_settings.js
+++ b/chrome/browser/resources/print_preview/settings/other_options_settings.js
@@ -127,14 +127,22 @@ cr.define('print_preview', function() {
* only ticket item.
* @param {!print_preview.ticket_items.HeaderFooter} headerFooter Header
* footer ticket item.
+ * @param {!print_preview.ticket_items.Rasterize} rasterize Rasterize ticket
+ * item.
* @constructor
* @extends {print_preview.SettingsSection}
*/
function OtherOptionsSettings(
- duplex, fitToPage, cssBackground, selectionOnly, headerFooter) {
+ duplex, fitToPage, cssBackground, selectionOnly, headerFooter,
+ rasterize) {
print_preview.SettingsSection.call(this);
+ /**
+ * @private {boolean} rasterizeEnabled Whether the print as image feature is
+ * enabled.
+ */
+ this.rasterizeEnabled_ = loadTimeData.getBoolean('printPdfAsImageEnabled');
- /*
+ /**
* @private {!Array<!CheckboxTicketItemElement>} checkbox ticket item
* elements representing the different options in the section.
* Selection only must always be the last element in the array.
@@ -150,7 +158,10 @@ cr.define('print_preview', function() {
new CheckboxTicketItemElement(selectionOnly, true,
'selection-only-container')
];
-
+ if (this.rasterizeEnabled_) {
+ this.elements_.splice(4, 0, new CheckboxTicketItemElement(rasterize,
dpapad 2016/12/22 19:27:00 Nit: This type of line breaking violates the "rect
rbpotter 2016/12/22 22:58:46 Done.
+ true, 'rasterize-container'));
+ }
};
OtherOptionsSettings.prototype = {
@@ -206,6 +217,8 @@ cr.define('print_preview', function() {
decorateInternal: function() {
for (var i = 0; i < this.elements_.length; i++)
this.elements_[i].decorate();
+ if (!this.rasterizeEnabled_)
+ $('rasterize-container').style.display = 'none';
dpapad 2016/12/22 19:27:00 Nit (optional): I think the following would also w
rbpotter 2016/12/22 22:58:46 Done.
},
/** @override */

Powered by Google App Engine
This is Rietveld 408576698