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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 * @private | 734 * @private |
735 */ | 735 */ |
736 onPrintPresetOptionsFromDocument_: function(options) { | 736 onPrintPresetOptionsFromDocument_: function(options) { |
737 var printPresetOptionsEvent = new Event( | 737 var printPresetOptionsEvent = new Event( |
738 NativeLayer.EventType.PRINT_PRESET_OPTIONS); | 738 NativeLayer.EventType.PRINT_PRESET_OPTIONS); |
739 printPresetOptionsEvent.optionsFromDocument = options; | 739 printPresetOptionsEvent.optionsFromDocument = options; |
740 this.dispatchEvent(printPresetOptionsEvent); | 740 this.dispatchEvent(printPresetOptionsEvent); |
741 }, | 741 }, |
742 | 742 |
743 /** | 743 /** |
744 * Updates the interface to show the "Distill Page" option | 744 * Updates the interface to show the "Simplify Page" option. |
745 * when PrintPreviewHandler::HandleIsPageDistillableResult | |
746 * determines that this page can be distilled with the | |
747 * DOM Distiller. | |
748 * @private | 745 * @private |
749 */ | 746 */ |
750 detectDistillablePage_: function() { | 747 allowDistillPage_: function() { |
751 var allowDistillPageEvent = new Event( | 748 var allowDistillPageEvent = new Event( |
752 NativeLayer.EventType.ALLOW_DISTILL_PAGE); | 749 NativeLayer.EventType.ALLOW_DISTILL_PAGE); |
753 this.dispatchEvent(allowDistillPageEvent); | 750 this.dispatchEvent(allowDistillPageEvent); |
754 }, | 751 }, |
755 | 752 |
756 /** | 753 /** |
757 * Simulates a user click on the print preview dialog cancel button. Used | 754 * Simulates a user click on the print preview dialog cancel button. Used |
758 * only for testing. | 755 * only for testing. |
759 * @private | 756 * @private |
760 */ | 757 */ |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 return this.serializedDefaultDestinationSelectionRulesStr_; | 1119 return this.serializedDefaultDestinationSelectionRulesStr_; |
1123 } | 1120 } |
1124 }; | 1121 }; |
1125 | 1122 |
1126 // Export | 1123 // Export |
1127 return { | 1124 return { |
1128 NativeInitialSettings: NativeInitialSettings, | 1125 NativeInitialSettings: NativeInitialSettings, |
1129 NativeLayer: NativeLayer | 1126 NativeLayer: NativeLayer |
1130 }; | 1127 }; |
1131 }); | 1128 }); |
OLD | NEW |