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

Side by Side 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: Change to match new Pdfium API 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('print_preview.ticket_items', function() {
6 'use strict';
7
8 /**
9 * Rasterize ticket item whose value is a {@code boolean} that indicates
10 * whether the PDF document should be rendered as images.
11 * @constructor
12 * @param {!print_preview.DestinationStore} destinationStore Destination store
13 * used determine if a destination should have the rasterize capability.
14 * @param {!print_preview.DocumentInfo} documentInfo Information about the
15 * document to print, used to determine if document is a PDF.
16 * @extends {print_preview.ticket_items.TicketItem}
17 */
18 function Rasterize(destinationStore, documentInfo) {
19 print_preview.ticket_items.TicketItem.call(
20 this, null /*appState*/, null /*field*/, destinationStore,
dpapad 2016/12/13 23:38:18 Nit: Add spaces /* appState */
rbpotter 2016/12/15 00:50:58 Done.
21 documentInfo);
22 };
23
24 Rasterize.prototype = {
25 __proto__: print_preview.ticket_items.TicketItem.prototype,
26
27 /** @override */
28 wouldValueBeValid: function(value) {
29 return true;
30 },
31
32 /** @override */
33 isCapabilityAvailable: function() {
34 return !this.getDocumentInfoInternal().isModifiable;
35 },
36
37 /** @override */
38 getDefaultValueInternal: function() {
39 return false;
40 },
41
42 /** @override */
43 getCapabilityNotAvailableValueInternal: function() {
44 return this.getDefaultValueInternal();
45 }
46 };
47
48 // Export
49 return {
50 Rasterize: Rasterize
51 };
52 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698