Chromium Code Reviews| 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..430856dd1203fc5f5eeeb463e5f2c3abc8ebc18d |
| --- /dev/null |
| +++ b/chrome/browser/resources/print_preview/data/ticket_items/rasterize.js |
| @@ -0,0 +1,52 @@ |
| +// 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.DestinationStore} destinationStore Destination store |
| + * used determine if a destination should have the rasterize capability. |
| + * @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*/, destinationStore, |
|
dpapad
2016/12/13 23:38:18
Nit: Add spaces
/* appState */
rbpotter
2016/12/15 00:50:58
Done.
|
| + 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 |
| + }; |
| +}); |