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 var localStrings = new LocalStrings(templateData); | 7 var localStrings = new LocalStrings(templateData); |
8 | 8 |
9 <include src="component.js"/> | 9 <include src="component.js"/> |
10 | 10 |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 // Ctrl + Shift + p / Mac equivalent. | 644 // Ctrl + Shift + p / Mac equivalent. |
645 if (e.keyCode == 80) { | 645 if (e.keyCode == 80) { |
646 if ((cr.isMac && e.metaKey && e.altKey && !e.shiftKey && !e.ctrlKey) || | 646 if ((cr.isMac && e.metaKey && e.altKey && !e.shiftKey && !e.ctrlKey) || |
647 (!cr.isMac && e.shiftKey && e.ctrlKey && !e.altKey && !e.metaKey)) { | 647 (!cr.isMac && e.shiftKey && e.ctrlKey && !e.altKey && !e.metaKey)) { |
648 this.openSystemPrintDialog_(); | 648 this.openSystemPrintDialog_(); |
649 e.preventDefault(); | 649 e.preventDefault(); |
650 return; | 650 return; |
651 } | 651 } |
652 } | 652 } |
653 | 653 |
| 654 if (e.keyCode == 13 /*enter*/ && this.printTicketStore_.isTicketValid()) { |
| 655 assert(this.uiState_ == PrintPreview.UiState_.READY, |
| 656 'Trying to print when not in ready state: ' + this.uiState_); |
| 657 this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/); |
| 658 e.preventDefault(); |
| 659 return; |
| 660 } |
| 661 |
654 // Pass certain directional keyboard events to the PDF viewer. | 662 // Pass certain directional keyboard events to the PDF viewer. |
655 this.previewArea_.handleDirectionalKeyEvent(e); | 663 this.previewArea_.handleDirectionalKeyEvent(e); |
656 }, | 664 }, |
657 | 665 |
658 /** | 666 /** |
659 * Called when native layer receives invalid settings for a print request. | 667 * Called when native layer receives invalid settings for a print request. |
660 * @private | 668 * @private |
661 */ | 669 */ |
662 onSettingsInvalid_: function() { | 670 onSettingsInvalid_: function() { |
663 this.uiState_ = PrintPreview.UiState_.ERROR; | 671 this.uiState_ = PrintPreview.UiState_.ERROR; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 <include src="search/cloud_destination_list.js"/> | 809 <include src="search/cloud_destination_list.js"/> |
802 <include src="search/destination_list_item.js"/> | 810 <include src="search/destination_list_item.js"/> |
803 <include src="search/destination_search.js"/> | 811 <include src="search/destination_search.js"/> |
804 <include src="search/search_box.js"/> | 812 <include src="search/search_box.js"/> |
805 <include src="search/fedex_tos.js"/> | 813 <include src="search/fedex_tos.js"/> |
806 | 814 |
807 window.addEventListener('DOMContentLoaded', function() { | 815 window.addEventListener('DOMContentLoaded', function() { |
808 printPreview = new print_preview.PrintPreview(); | 816 printPreview = new print_preview.PrintPreview(); |
809 printPreview.initialize(); | 817 printPreview.initialize(); |
810 }); | 818 }); |
OLD | NEW |