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 // TODO(rltoscano): Move data/* into print_preview.data namespace | 5 // TODO(rltoscano): Move data/* into print_preview.data namespace |
6 | 6 |
7 <include src="component.js"> | 7 <include src="component.js"> |
8 <include src="print_preview_focus_manager.js"> | 8 <include src="print_preview_focus_manager.js"> |
9 | 9 |
10 cr.define('print_preview', function() { | 10 cr.define('print_preview', function() { |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 * Consume escape key presses and ctrl + shift + p. Delegate everything else | 896 * Consume escape key presses and ctrl + shift + p. Delegate everything else |
897 * to the preview area. | 897 * to the preview area. |
898 * @param {KeyboardEvent} e The keyboard event. | 898 * @param {KeyboardEvent} e The keyboard event. |
899 * @private | 899 * @private |
900 * @suppress {uselessCode} | 900 * @suppress {uselessCode} |
901 * Current compiler preprocessor leaves all the code inside all the <if>s, | 901 * Current compiler preprocessor leaves all the code inside all the <if>s, |
902 * so the compiler claims that code after first return is unreachable. | 902 * so the compiler claims that code after first return is unreachable. |
903 */ | 903 */ |
904 onKeyDown_: function(e) { | 904 onKeyDown_: function(e) { |
905 // Escape key closes the dialog. | 905 // Escape key closes the dialog. |
906 if (e.keyCode == 27 && !e.shiftKey && !e.ctrlKey && !e.altKey && | 906 if (e.keyCode == 27 && !hasKeyModifiers(e)) { |
907 !e.metaKey) { | |
908 // On non-mac with toolkit-views, ESC key is handled by C++-side instead | 907 // On non-mac with toolkit-views, ESC key is handled by C++-side instead |
909 // of JS-side. | 908 // of JS-side. |
910 if (cr.isMac) { | 909 if (cr.isMac) { |
911 this.close_(); | 910 this.close_(); |
912 e.preventDefault(); | 911 e.preventDefault(); |
913 } | 912 } |
914 return; | 913 return; |
915 } | 914 } |
916 | 915 |
917 // On Mac, Cmd-. should close the print dialog. | 916 // On Mac, Cmd-. should close the print dialog. |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 <include src="search/recent_destination_list.js"> | 1359 <include src="search/recent_destination_list.js"> |
1361 <include src="search/destination_list_item.js"> | 1360 <include src="search/destination_list_item.js"> |
1362 <include src="search/destination_search.js"> | 1361 <include src="search/destination_search.js"> |
1363 <include src="search/fedex_tos.js"> | 1362 <include src="search/fedex_tos.js"> |
1364 <include src="search/provisional_destination_resolver.js"> | 1363 <include src="search/provisional_destination_resolver.js"> |
1365 | 1364 |
1366 window.addEventListener('DOMContentLoaded', function() { | 1365 window.addEventListener('DOMContentLoaded', function() { |
1367 printPreview = new print_preview.PrintPreview(); | 1366 printPreview = new print_preview.PrintPreview(); |
1368 printPreview.initialize(); | 1367 printPreview.initialize(); |
1369 }); | 1368 }); |
OLD | NEW |