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 */ |