1 // Copyright (c) 2012 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.
5 cr.define('print_preview.ticket_items', function() {
9 * Fit-to-page ticket item whose value is a {@code boolean} that indicates
10 * whether to scale the document to fit the page.
11 * @param {!print_preview.DocumentInfo} documentInfo Information about the
13 * @param {!print_preview.DestinationStore} destinationStore Used to determine
14 * whether fit to page should be available.
16 * @extends {print_preview.ticket_items.TicketItem}
18 function FitToPage(documentInfo, destinationStore) {
19 print_preview.ticket_items.TicketItem.call(
27 FitToPage.prototype = {
28 __proto__: print_preview.ticket_items.TicketItem.prototype,
31 wouldValueBeValid: function(value) {
36 isCapabilityAvailable: function() {
37 return !this.getDocumentInfoInternal().isModifiable &&
38 (!this.getSelectedDestInternal() ||
39 this.getSelectedDestInternal().id !=
40 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF);
44 getDefaultValueInternal: function() {
45 return !this.getDocumentInfoInternal().isScalingDisabled;
49 getCapabilityNotAvailableValueInternal: function() {
50 return !this.getSelectedDestInternal() ||
51 this.getSelectedDestInternal().id !=
52 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF;