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

Side by Side Diff: chrome/browser/resources/print_preview/data/ticket_items/fit_to_page.js

Issue 10108001: Refactor print preview web ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve conflicts Created 8 years, 7 months 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 cr.define('print_preview.ticket_items', function() {
6 'use strict';
7
8 /**
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
12 * document to print.
13 * @param {!print_preview.DestinationStore} destinationStore Used to determine
14 * whether fit to page should be available.
15 * @constructor
16 * @extends {print_preview.ticket_items.TicketItem}
17 */
18 function FitToPage(documentInfo, destinationStore) {
19 print_preview.ticket_items.TicketItem.call(this);
20
21 /**
22 * Information about the document to print.
23 * @type {!print_preview.DocumentInfo}
24 * @private
25 */
26 this.documentInfo_ = documentInfo;
27
28 /**
29 * Used to determine whether fit to page should be available.
30 * @type {!print_preview.DestinationStore}
31 * @private
32 */
33 this.destinationStore_ = destinationStore;
34 };
35
36 FitToPage.prototype = {
37 __proto__: print_preview.ticket_items.TicketItem.prototype,
38
39 /** @override */
40 wouldValueBeValid: function(value) {
41 return true;
42 },
43
44 /** @override */
45 isCapabilityAvailable: function() {
46 return !this.documentInfo_.isModifiable &&
47 (!this.destinationStore_.selectedDestination ||
48 this.destinationStore_.selectedDestination.id !=
49 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF);
50 },
51
52 /** @override */
53 getDefaultValueInternal: function() {
54 return true;
55 },
56
57 /** @override */
58 getCapabilityNotAvailableValueInternal: function() {
59 return this.destinationStore_.selectedDestination &&
60 this.destinationStore_.selectedDestination.id ==
61 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF;
62 }
63 };
64
65 // Export
66 return {
67 FitToPage: FitToPage
68 };
69 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698