Allow only one bookmark to be added for multiple fast starring
[chromium-blink-merge.git] / chrome / browser / resources / print_preview / data / ticket_items / selection_only.js
blobf129a0f7bfb030796a6076ebec386e0740f544b6
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() {
6 'use strict';
8 /**
9 * Ticket item whose value is a {@code boolean} that represents whether to
10 * print selection only.
11 * @param {!print_preview.DocumentInfo} documentInfo Information about the
12 * document to print.
13 * @constructor
14 * @extends {print_preview.ticket_items.TicketItem}
16 function SelectionOnly(documentInfo) {
17 print_preview.ticket_items.TicketItem.call(
18 this,
19 null /*appState*/,
20 null /*field*/,
21 null /*destinationStore*/,
22 documentInfo);
25 SelectionOnly.prototype = {
26 __proto__: print_preview.ticket_items.TicketItem.prototype,
28 /** @override */
29 wouldValueBeValid: function(value) {
30 return true;
33 /** @override */
34 isCapabilityAvailable: function() {
35 return this.getDocumentInfoInternal().isModifiable &&
36 this.getDocumentInfoInternal().hasSelection;
39 /** @override */
40 getDefaultValueInternal: function() {
41 return false;
44 /** @override */
45 getCapabilityNotAvailableValueInternal: function() {
46 return false;
50 // Export
51 return {
52 SelectionOnly: SelectionOnly
54 });