| 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.exportPath('print_preview'); | 5 cr.exportPath('print_preview'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @typedef {{selectSaveAsPdfDestination: boolean, | 8 * @typedef {{selectSaveAsPdfDestination: boolean, |
| 9 * layoutSettings.portrait: boolean, | 9 * layoutSettings.portrait: boolean, |
| 10 * pageRange: string, | 10 * pageRange: string, |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 'printWithCloudPrint': destination != null && !destination.isLocal, | 237 'printWithCloudPrint': destination != null && !destination.isLocal, |
| 238 'printWithPrivet': destination != null && destination.isPrivet, | 238 'printWithPrivet': destination != null && destination.isPrivet, |
| 239 'deviceName': destination == null ? 'foo' : destination.id, | 239 'deviceName': destination == null ? 'foo' : destination.id, |
| 240 'generateDraftData': documentInfo.isModifiable, | 240 'generateDraftData': documentInfo.isModifiable, |
| 241 'fitToPageEnabled': printTicketStore.fitToPage.getValue(), | 241 'fitToPageEnabled': printTicketStore.fitToPage.getValue(), |
| 242 | 242 |
| 243 // NOTE: Even though the following fields don't directly relate to the | 243 // NOTE: Even though the following fields don't directly relate to the |
| 244 // preview, they still need to be included. | 244 // preview, they still need to be included. |
| 245 'duplex': printTicketStore.duplex.getValue() ? | 245 'duplex': printTicketStore.duplex.getValue() ? |
| 246 NativeLayer.DuplexMode.LONG_EDGE : NativeLayer.DuplexMode.SIMPLEX, | 246 NativeLayer.DuplexMode.LONG_EDGE : NativeLayer.DuplexMode.SIMPLEX, |
| 247 'copies': printTicketStore.copies.getValueAsNumber(), | 247 'copies': 1, |
| 248 'collate': printTicketStore.collate.getValue(), | 248 'collate': true, |
| 249 'shouldPrintBackgrounds': printTicketStore.cssBackground.getValue(), | 249 'shouldPrintBackgrounds': printTicketStore.cssBackground.getValue(), |
| 250 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue() | 250 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue() |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 // Set 'cloudPrintID' only if the destination is not local. | 253 // Set 'cloudPrintID' only if the destination is not local. |
| 254 if (destination && !destination.isLocal) { | 254 if (destination && !destination.isLocal) { |
| 255 ticket['cloudPrintID'] = destination.id; | 255 ticket['cloudPrintID'] = destination.id; |
| 256 } | 256 } |
| 257 | 257 |
| 258 if (printTicketStore.marginsType.isCapabilityAvailable() && | 258 if (printTicketStore.marginsType.isCapabilityAvailable() && |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 return this.serializedAppStateStr_; | 955 return this.serializedAppStateStr_; |
| 956 } | 956 } |
| 957 }; | 957 }; |
| 958 | 958 |
| 959 // Export | 959 // Export |
| 960 return { | 960 return { |
| 961 NativeInitialSettings: NativeInitialSettings, | 961 NativeInitialSettings: NativeInitialSettings, |
| 962 NativeLayer: NativeLayer | 962 NativeLayer: NativeLayer |
| 963 }; | 963 }; |
| 964 }); | 964 }); |
| OLD | NEW |