| Index: chrome/browser/resources/print_preview/data/ticket_items/distill_page.js
|
| diff --git a/chrome/browser/resources/print_preview/data/ticket_items/selection_only.js b/chrome/browser/resources/print_preview/data/ticket_items/distill_page.js
|
| similarity index 69%
|
| copy from chrome/browser/resources/print_preview/data/ticket_items/selection_only.js
|
| copy to chrome/browser/resources/print_preview/data/ticket_items/distill_page.js
|
| index f129a0f7bfb030796a6076ebec386e0740f544b6..9e99b94290207b21371392760ae6657f7208167c 100644
|
| --- a/chrome/browser/resources/print_preview/data/ticket_items/selection_only.js
|
| +++ b/chrome/browser/resources/print_preview/data/ticket_items/distill_page.js
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright 2015 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.
|
|
|
| @@ -7,22 +7,24 @@ cr.define('print_preview.ticket_items', function() {
|
|
|
| /**
|
| * Ticket item whose value is a {@code boolean} that represents whether to
|
| - * print selection only.
|
| + * distill the page before printing.
|
| * @param {!print_preview.DocumentInfo} documentInfo Information about the
|
| * document to print.
|
| * @constructor
|
| * @extends {print_preview.ticket_items.TicketItem}
|
| */
|
| - function SelectionOnly(documentInfo) {
|
| + function DistillPage(documentInfo) {
|
| print_preview.ticket_items.TicketItem.call(
|
| this,
|
| null /*appState*/,
|
| null /*field*/,
|
| null /*destinationStore*/,
|
| documentInfo);
|
| +
|
| + this.isAvailable_ = false;
|
| };
|
|
|
| - SelectionOnly.prototype = {
|
| + DistillPage.prototype = {
|
| __proto__: print_preview.ticket_items.TicketItem.prototype,
|
|
|
| /** @override */
|
| @@ -32,8 +34,7 @@ cr.define('print_preview.ticket_items', function() {
|
|
|
| /** @override */
|
| isCapabilityAvailable: function() {
|
| - return this.getDocumentInfoInternal().isModifiable &&
|
| - this.getDocumentInfoInternal().hasSelection;
|
| + return this.isAvailable_;
|
| },
|
|
|
| /** @override */
|
| @@ -44,11 +45,19 @@ cr.define('print_preview.ticket_items', function() {
|
| /** @override */
|
| getCapabilityNotAvailableValueInternal: function() {
|
| return false;
|
| + },
|
| +
|
| + setIsCapabilityAvailable: function(isAvailable) {
|
| + if (this.isAvailable_ == isAvailable)
|
| + return;
|
| +
|
| + this.isAvailable_ = isAvailable;
|
| + this.dispatchChangeEventInternal();
|
| }
|
| };
|
|
|
| // Export
|
| return {
|
| - SelectionOnly: SelectionOnly
|
| + DistillPage: DistillPage
|
| };
|
| });
|
|
|