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

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

Issue 2862203002: Print Preview: Fix data/ errors (Closed)
Patch Set: Fix destination resolver Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('print_preview.ticket_items', function() { 5 cr.define('print_preview.ticket_items', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * DPI ticket item. 9 * DPI ticket item.
10 * @param {!print_preview.AppState} appState App state used to persist DPI 10 * @param {!print_preview.AppState} appState App state used to persist DPI
11 * selection. 11 * selection.
12 * @param {!print_preview.DestinationStore} destinationStore Destination store 12 * @param {!print_preview.DestinationStore} destinationStore Destination store
13 * used to determine if a destination has the DPI capability. 13 * used to determine if a destination has the DPI capability.
14 * @constructor 14 * @constructor
15 * @extends {print_preview.ticket_items.TicketItem} 15 * @extends {print_preview.ticket_items.TicketItem}
16 */ 16 */
17 function Dpi(appState, destinationStore) { 17 function Dpi(appState, destinationStore) {
18 print_preview.ticket_items.TicketItem.call( 18 print_preview.ticket_items.TicketItem.call(
19 this, 19 this,
20 appState, 20 appState,
21 print_preview.AppState.Field.DPI, 21 print_preview.AppStateField.DPI,
22 destinationStore); 22 destinationStore);
23 }; 23 }
24 24
25 Dpi.prototype = { 25 Dpi.prototype = {
26 __proto__: print_preview.ticket_items.TicketItem.prototype, 26 __proto__: print_preview.ticket_items.TicketItem.prototype,
27 27
28 /** @override */ 28 /** @override */
29 wouldValueBeValid: function(value) { 29 wouldValueBeValid: function(value) {
30 if (!this.isCapabilityAvailable()) 30 if (!this.isCapabilityAvailable())
31 return false; 31 return false;
32 return this.capability.option.some(function(option) { 32 return this.capability.option.some(function(option) {
33 return option.horizontal_dpi == value.horizontal_dpi && 33 return option.horizontal_dpi == value.horizontal_dpi &&
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 getCapabilityNotAvailableValueInternal: function() { 73 getCapabilityNotAvailableValueInternal: function() {
74 return {}; 74 return {};
75 } 75 }
76 }; 76 };
77 77
78 // Export 78 // Export
79 return { 79 return {
80 Dpi: Dpi 80 Dpi: Dpi
81 }; 81 };
82 }); 82 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698