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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue() | 319 'shouldPrintSelectionOnly': printTicketStore.selectionOnly.getValue() |
320 }; | 320 }; |
321 | 321 |
322 // Set 'cloudPrintID' only if the destination is not local. | 322 // Set 'cloudPrintID' only if the destination is not local. |
323 if (destination && !destination.isLocal) { | 323 if (destination && !destination.isLocal) { |
324 ticket['cloudPrintID'] = destination.id; | 324 ticket['cloudPrintID'] = destination.id; |
325 } | 325 } |
326 | 326 |
327 if (printTicketStore.marginsType.isCapabilityAvailable() && | 327 if (printTicketStore.marginsType.isCapabilityAvailable() && |
328 printTicketStore.marginsType.getValue() == | 328 printTicketStore.marginsType.getValue() == |
329 print_preview.ticket_items.MarginsType.Value.CUSTOM) { | 329 print_preview.ticket_items.MarginsTypeValue.CUSTOM) { |
330 var customMargins = printTicketStore.customMargins.getValue(); | 330 var customMargins = printTicketStore.customMargins.getValue(); |
331 var orientationEnum = | 331 var orientationEnum = |
332 print_preview.ticket_items.CustomMargins.Orientation; | 332 print_preview.ticket_items.CustomMargins.Orientation; |
333 ticket['marginsCustom'] = { | 333 ticket['marginsCustom'] = { |
334 'marginTop': customMargins.get(orientationEnum.TOP), | 334 'marginTop': customMargins.get(orientationEnum.TOP), |
335 'marginRight': customMargins.get(orientationEnum.RIGHT), | 335 'marginRight': customMargins.get(orientationEnum.RIGHT), |
336 'marginBottom': customMargins.get(orientationEnum.BOTTOM), | 336 'marginBottom': customMargins.get(orientationEnum.BOTTOM), |
337 'marginLeft': customMargins.get(orientationEnum.LEFT) | 337 'marginLeft': customMargins.get(orientationEnum.LEFT) |
338 }; | 338 }; |
339 } | 339 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 401 |
402 if (!destination.isLocal) { | 402 if (!destination.isLocal) { |
403 // We can't set cloudPrintID if the destination is "Print with Cloud | 403 // We can't set cloudPrintID if the destination is "Print with Cloud |
404 // Print" because the native system will try to print to Google Cloud | 404 // Print" because the native system will try to print to Google Cloud |
405 // Print with this ID instead of opening a Google Cloud Print dialog. | 405 // Print with this ID instead of opening a Google Cloud Print dialog. |
406 ticket['cloudPrintID'] = destination.id; | 406 ticket['cloudPrintID'] = destination.id; |
407 } | 407 } |
408 | 408 |
409 if (printTicketStore.marginsType.isCapabilityAvailable() && | 409 if (printTicketStore.marginsType.isCapabilityAvailable() && |
410 printTicketStore.marginsType.isValueEqual( | 410 printTicketStore.marginsType.isValueEqual( |
411 print_preview.ticket_items.MarginsType.Value.CUSTOM)) { | 411 print_preview.ticket_items.MarginsTypeValue.CUSTOM)) { |
412 var customMargins = printTicketStore.customMargins.getValue(); | 412 var customMargins = printTicketStore.customMargins.getValue(); |
413 var orientationEnum = | 413 var orientationEnum = |
414 print_preview.ticket_items.CustomMargins.Orientation; | 414 print_preview.ticket_items.CustomMargins.Orientation; |
415 ticket['marginsCustom'] = { | 415 ticket['marginsCustom'] = { |
416 'marginTop': customMargins.get(orientationEnum.TOP), | 416 'marginTop': customMargins.get(orientationEnum.TOP), |
417 'marginRight': customMargins.get(orientationEnum.RIGHT), | 417 'marginRight': customMargins.get(orientationEnum.RIGHT), |
418 'marginBottom': customMargins.get(orientationEnum.BOTTOM), | 418 'marginBottom': customMargins.get(orientationEnum.BOTTOM), |
419 'marginLeft': customMargins.get(orientationEnum.LEFT) | 419 'marginLeft': customMargins.get(orientationEnum.LEFT) |
420 }; | 420 }; |
421 } | 421 } |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 return this.serializedDefaultDestinationSelectionRulesStr_; | 1106 return this.serializedDefaultDestinationSelectionRulesStr_; |
1107 } | 1107 } |
1108 }; | 1108 }; |
1109 | 1109 |
1110 // Export | 1110 // Export |
1111 return { | 1111 return { |
1112 NativeInitialSettings: NativeInitialSettings, | 1112 NativeInitialSettings: NativeInitialSettings, |
1113 NativeLayer: NativeLayer | 1113 NativeLayer: NativeLayer |
1114 }; | 1114 }; |
1115 }); | 1115 }); |
OLD | NEW |