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

Unified Diff: chrome/browser/resources/print_preview/data/ticket_items/rasterize.js

Issue 2524143003: Print Preview: Add option to rasterize PDFs and add JPEG compression. (Closed)
Patch Set: Clean up JS 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/data/ticket_items/rasterize.js
diff --git a/chrome/browser/resources/print_preview/data/ticket_items/rasterize.js b/chrome/browser/resources/print_preview/data/ticket_items/rasterize.js
new file mode 100644
index 0000000000000000000000000000000000000000..b8ea06d2ed481ad6a8137c4d4eb1435570803bfb
--- /dev/null
+++ b/chrome/browser/resources/print_preview/data/ticket_items/rasterize.js
@@ -0,0 +1,50 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('print_preview.ticket_items', function() {
+ 'use strict';
+
+ /**
+ * Rasterize ticket item whose value is a {@code boolean} that indicates
+ * whether the PDF document should be rendered as images.
+ * @constructor
+ * @param {!print_preview.DocumentInfo} documentInfo Information about the
+ * document to print, used to determine if document is a PDF.
+ * @extends {print_preview.ticket_items.TicketItem}
+ */
+ function Rasterize(destinationStore, documentInfo) {
+ print_preview.ticket_items.TicketItem.call(
+ this, null /* appState */, null /* field */,
+ null /* destinationStore */, documentInfo);
+ };
+
+ Rasterize.prototype = {
+ __proto__: print_preview.ticket_items.TicketItem.prototype,
+
+ /** @override */
+ wouldValueBeValid: function(value) {
+ return true;
+ },
+
+ /** @override */
+ isCapabilityAvailable: function() {
+ return !this.getDocumentInfoInternal().isModifiable;
+ },
+
+ /** @override */
+ getDefaultValueInternal: function() {
+ return false;
+ },
+
+ /** @override */
+ getCapabilityNotAvailableValueInternal: function() {
+ return this.getDefaultValueInternal();
+ }
+ };
+
+ // Export
+ return {
+ Rasterize: Rasterize
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698