OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * A data store that stores destinations and dispatches events when the data | 9 * A data store that stores destinations and dispatches events when the data |
10 * store changes. | 10 * store changes. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 var mediaSize = capabilities.printer.media_size; | 203 var mediaSize = capabilities.printer.media_size; |
204 if (mediaSize) { | 204 if (mediaSize) { |
205 var mediaDisplayNames = { | 205 var mediaDisplayNames = { |
206 'ISO_A4': 'A4', | 206 'ISO_A4': 'A4', |
207 'ISO_A3': 'A3', | 207 'ISO_A3': 'A3', |
208 'NA_LETTER': 'Letter', | 208 'NA_LETTER': 'Letter', |
209 'NA_LEGAL': 'Legal', | 209 'NA_LEGAL': 'Legal', |
210 'NA_LEDGER': 'Tabloid' | 210 'NA_LEDGER': 'Tabloid' |
211 }; | 211 }; |
212 for (var i = 0, media; media = mediaSize.option[i]; i++) { | 212 for (var i = 0, media; media = mediaSize.option[i]; i++) { |
213 media.custom_display_name = mediaDisplayNames[media.name] || media.name; | 213 media.custom_display_name = |
| 214 media.custom_display_name || |
| 215 mediaDisplayNames[media.name] || |
| 216 media.name; |
214 } | 217 } |
215 } | 218 } |
216 return capabilities; | 219 return capabilities; |
217 }; | 220 }; |
218 | 221 |
219 DestinationStore.prototype = { | 222 DestinationStore.prototype = { |
220 __proto__: cr.EventTarget.prototype, | 223 __proto__: cr.EventTarget.prototype, |
221 | 224 |
222 /** | 225 /** |
223 * @param {string=} opt_account Account to filter destinations by. When | 226 * @param {string=} opt_account Account to filter destinations by. When |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 return id == this.appState_.selectedDestinationId && | 936 return id == this.appState_.selectedDestinationId && |
934 origin == this.appState_.selectedDestinationOrigin; | 937 origin == this.appState_.selectedDestinationOrigin; |
935 } | 938 } |
936 }; | 939 }; |
937 | 940 |
938 // Export | 941 // Export |
939 return { | 942 return { |
940 DestinationStore: DestinationStore | 943 DestinationStore: DestinationStore |
941 }; | 944 }; |
942 }); | 945 }); |
OLD | NEW |