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

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

Issue 10108001: Refactor print preview web ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes broken tests 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 * Collate ticket item whose value is a {@code boolean} that indicates whether
10 * collation is enabled.
11 * @param {!print_preview.CapabilitiesHolder} capabilitiesHolder Capabilities
12 * holder used to determine the default collate value and if the collate
13 * capability is available.
14 * @constructor
15 * @extends {print_preview.ticket_items.TicketItem}
16 */
17 function Collate(capabilitiesHolder) {
18 print_preview.ticket_items.TicketItem.call(this);
19
20 /**
21 * Capabilities holder used to determine the default collate value and if
22 * the collate capability is available.
23 * @type {!print_preview.CapabilitiesHolder}
24 * @private
25 */
26 this.capabilitiesHolder_ = capabilitiesHolder;
27 };
28
29 Collate.prototype = {
30 __proto__: print_preview.ticket_items.TicketItem.prototype,
31
32 /** @override */
33 wouldValueBeValid: function(value) {
34 return true;
35 },
36
37 /** @override */
38 isCapabilityAvailable: function() {
39 return this.capabilitiesHolder_.get().hasCollateCapability;
40 },
41
42 /** @override */
43 getDefaultValueInternal: function() {
44 return this.capabilitiesHolder_.get().defaultIsCollateEnabled;
45 },
46
47 /** @override */
48 getCapabilityNotAvailableValueInternal: function() {
49 return false;
50 }
51 };
52
53 // Export
54 return {
55 Collate: Collate
56 };
57 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698