Chromium Code Reviews| Index: chrome/browser/resources/print_preview/data/ticket_items/margins_type.js |
| diff --git a/chrome/browser/resources/print_preview/data/ticket_items/margins_type.js b/chrome/browser/resources/print_preview/data/ticket_items/margins_type.js |
| index 2daa9193c68e985f966fe6dd4a3b709839cd9afb..119cf4a599fbb5237e62018da7944f7ab66ace38 100644 |
| --- a/chrome/browser/resources/print_preview/data/ticket_items/margins_type.js |
| +++ b/chrome/browser/resources/print_preview/data/ticket_items/margins_type.js |
| @@ -2,12 +2,25 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +/** |
| + * Must be kept in sync with the C++ MarginType enum in |
| + * printing/print_job_constants.h. |
| + * @enum {number} |
| + */ |
| +print_preview.ticket_items.MarginsTypeValue = { |
|
dpapad
2017/05/04 01:20:03
This relies on the fact that some other file has c
rbpotter
2017/05/04 01:43:06
Done.
|
| + DEFAULT: 0, |
| + NO_MARGINS: 1, |
| + MINIMUM: 2, |
| + CUSTOM: 3 |
| +}; |
| + |
| + |
| cr.define('print_preview.ticket_items', function() { |
| 'use strict'; |
| /** |
| * Margins type ticket item whose value is a |
| - * {@link print_preview.ticket_items.MarginsType.Value} that indicates what |
| + * print_preview.ticket_items.MarginsTypeValue} that indicates what |
| * predefined margins type to use. |
| * @param {!print_preview.AppState} appState App state persistence object to |
| * save the state of the margins type selection. |
| @@ -34,18 +47,6 @@ cr.define('print_preview.ticket_items', function() { |
| this.customMargins_ = customMargins; |
| }; |
| - /** |
| - * Enumeration of margin types. Matches enum MarginType in |
| - * printing/print_job_constants.h. |
| - * @enum {number} |
| - */ |
| - MarginsType.Value = { |
| - DEFAULT: 0, |
| - NO_MARGINS: 1, |
| - MINIMUM: 2, |
| - CUSTOM: 3 |
| - }; |
| - |
| MarginsType.prototype = { |
| __proto__: print_preview.ticket_items.TicketItem.prototype, |
| @@ -61,12 +62,12 @@ cr.define('print_preview.ticket_items', function() { |
| /** @override */ |
| getDefaultValueInternal: function() { |
| - return MarginsType.Value.DEFAULT; |
| + return print_preview.ticket_items.MarginsTypeValue.DEFAULT; |
| }, |
| /** @override */ |
| getCapabilityNotAvailableValueInternal: function() { |
| - return MarginsType.Value.DEFAULT; |
| + return print_preview.ticket_items.MarginsTypeValue.DEFAULT; |
| }, |
| /** @override */ |
| @@ -74,7 +75,7 @@ cr.define('print_preview.ticket_items', function() { |
| print_preview.ticket_items.TicketItem.prototype.updateValueInternal.call( |
| this, value); |
| if (this.isValueEqual( |
| - print_preview.ticket_items.MarginsType.Value.CUSTOM)) { |
| + print_preview.ticket_items.MarginsTypeValue.CUSTOM)) { |
| // If CUSTOM, set the value of the custom margins so that it won't be |
| // overridden by the default value. |
| this.customMargins_.updateValue(this.customMargins_.getValue()); |