Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: chrome/browser/resources/print_preview/native_layer.js

Issue 1419063002: Displaying "simplify page" on print preview by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small refactors, formatting, and removing call to distillation heuristics. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 "Distill Page" option
745 * when PrintPreviewHandler::HandleIsPageDistillableResult 745 * when PrintPreviewHandler::HandleIsPageDistillableResult
746 * determines that this page can be distilled with the 746 * determines that this page can be distilled with the
747 * DOM Distiller. 747 * DOM Distiller.
748 * @private 748 * @private
749 */ 749 */
750 detectDistillablePage_: function() { 750 allowDistillPage_: function() {
751 var allowDistillPageEvent = new Event( 751 var allowDistillPageEvent = new Event(
752 NativeLayer.EventType.ALLOW_DISTILL_PAGE); 752 NativeLayer.EventType.ALLOW_DISTILL_PAGE);
753 this.dispatchEvent(allowDistillPageEvent); 753 this.dispatchEvent(allowDistillPageEvent);
754 }, 754 },
755 755
756 /** 756 /**
757 * Simulates a user click on the print preview dialog cancel button. Used 757 * Simulates a user click on the print preview dialog cancel button. Used
758 * only for testing. 758 * only for testing.
759 * @private 759 * @private
760 */ 760 */
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 return this.serializedDefaultDestinationSelectionRulesStr_; 1122 return this.serializedDefaultDestinationSelectionRulesStr_;
1123 } 1123 }
1124 }; 1124 };
1125 1125
1126 // Export 1126 // Export
1127 return { 1127 return {
1128 NativeInitialSettings: NativeInitialSettings, 1128 NativeInitialSettings: NativeInitialSettings,
1129 NativeLayer: NativeLayer 1129 NativeLayer: NativeLayer
1130 }; 1130 };
1131 }); 1131 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698