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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 this.onPrivetCapabilitiesSet_.bind(this); | 60 this.onPrivetCapabilitiesSet_.bind(this); |
61 global.onPrivetPrintFailed = this.onPrivetPrintFailed_.bind(this); | 61 global.onPrivetPrintFailed = this.onPrivetPrintFailed_.bind(this); |
62 global.onExtensionPrintersAdded = | 62 global.onExtensionPrintersAdded = |
63 this.onExtensionPrintersAdded_.bind(this); | 63 this.onExtensionPrintersAdded_.bind(this); |
64 global.onExtensionCapabilitiesSet = | 64 global.onExtensionCapabilitiesSet = |
65 this.onExtensionCapabilitiesSet_.bind(this); | 65 this.onExtensionCapabilitiesSet_.bind(this); |
66 global.onEnableManipulateSettingsForTest = | 66 global.onEnableManipulateSettingsForTest = |
67 this.onEnableManipulateSettingsForTest_.bind(this); | 67 this.onEnableManipulateSettingsForTest_.bind(this); |
68 global.printPresetOptionsFromDocument = | 68 global.printPresetOptionsFromDocument = |
69 this.onPrintPresetOptionsFromDocument_.bind(this); | 69 this.onPrintPresetOptionsFromDocument_.bind(this); |
70 global.detectDistillablePage = | 70 global.allowDistillPage = |
71 this.detectDistillablePage_.bind(this); | 71 this.allowDistillPage_.bind(this); |
72 global.onProvisionalPrinterResolved = | 72 global.onProvisionalPrinterResolved = |
73 this.onProvisionalDestinationResolved_.bind(this); | 73 this.onProvisionalDestinationResolved_.bind(this); |
74 global.failedToResolveProvisionalPrinter = | 74 global.failedToResolveProvisionalPrinter = |
75 this.failedToResolveProvisionalDestination_.bind(this); | 75 this.failedToResolveProvisionalDestination_.bind(this); |
76 }; | 76 }; |
77 | 77 |
78 /** | 78 /** |
79 * Event types dispatched from the Chromium native layer. | 79 * Event types dispatched from the Chromium native layer. |
80 * @enum {string} | 80 * @enum {string} |
81 * @const | 81 * @const |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 * @private | 735 * @private |
736 */ | 736 */ |
737 onPrintPresetOptionsFromDocument_: function(options) { | 737 onPrintPresetOptionsFromDocument_: function(options) { |
738 var printPresetOptionsEvent = new Event( | 738 var printPresetOptionsEvent = new Event( |
739 NativeLayer.EventType.PRINT_PRESET_OPTIONS); | 739 NativeLayer.EventType.PRINT_PRESET_OPTIONS); |
740 printPresetOptionsEvent.optionsFromDocument = options; | 740 printPresetOptionsEvent.optionsFromDocument = options; |
741 this.dispatchEvent(printPresetOptionsEvent); | 741 this.dispatchEvent(printPresetOptionsEvent); |
742 }, | 742 }, |
743 | 743 |
744 /** | 744 /** |
745 * Updates the interface to show the "Distill Page" option | 745 * Updates the interface to show the "Simplify Page" option. |
746 * when PrintPreviewHandler::HandleIsPageDistillableResult | |
747 * determines that this page can be distilled with the | |
748 * DOM Distiller. | |
749 * @private | 746 * @private |
750 */ | 747 */ |
751 detectDistillablePage_: function() { | 748 allowDistillPage_: function() { |
752 var allowDistillPageEvent = new Event( | 749 var allowDistillPageEvent = new Event( |
753 NativeLayer.EventType.ALLOW_DISTILL_PAGE); | 750 NativeLayer.EventType.ALLOW_DISTILL_PAGE); |
754 this.dispatchEvent(allowDistillPageEvent); | 751 this.dispatchEvent(allowDistillPageEvent); |
755 }, | 752 }, |
756 | 753 |
757 /** | 754 /** |
758 * Simulates a user click on the print preview dialog cancel button. Used | 755 * Simulates a user click on the print preview dialog cancel button. Used |
759 * only for testing. | 756 * only for testing. |
760 * @private | 757 * @private |
761 */ | 758 */ |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 return this.serializedDefaultDestinationSelectionRulesStr_; | 1120 return this.serializedDefaultDestinationSelectionRulesStr_; |
1124 } | 1121 } |
1125 }; | 1122 }; |
1126 | 1123 |
1127 // Export | 1124 // Export |
1128 return { | 1125 return { |
1129 NativeInitialSettings: NativeInitialSettings, | 1126 NativeInitialSettings: NativeInitialSettings, |
1130 NativeLayer: NativeLayer | 1127 NativeLayer: NativeLayer |
1131 }; | 1128 }; |
1132 }); | 1129 }); |
OLD | NEW |