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

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

Issue 10827332: Swallow 'enter' key press if destination search dialog is open. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 // Ctrl + Shift + p / Mac equivalent. 650 // Ctrl + Shift + p / Mac equivalent.
651 if (e.keyCode == 80) { 651 if (e.keyCode == 80) {
652 if ((cr.isMac && e.metaKey && e.altKey && !e.shiftKey && !e.ctrlKey) || 652 if ((cr.isMac && e.metaKey && e.altKey && !e.shiftKey && !e.ctrlKey) ||
653 (!cr.isMac && e.shiftKey && e.ctrlKey && !e.altKey && !e.metaKey)) { 653 (!cr.isMac && e.shiftKey && e.ctrlKey && !e.altKey && !e.metaKey)) {
654 this.openSystemPrintDialog_(); 654 this.openSystemPrintDialog_();
655 e.preventDefault(); 655 e.preventDefault();
656 return; 656 return;
657 } 657 }
658 } 658 }
659 659
660 if (e.keyCode == 13 /*enter*/ && this.printTicketStore_.isTicketValid()) { 660 if (e.keyCode == 13 /*enter*/ &&
661 !this.destinationSearch_.getIsVisible() &&
662 this.printTicketStore_.isTicketValid()) {
661 assert(this.uiState_ == PrintPreview.UiState_.READY, 663 assert(this.uiState_ == PrintPreview.UiState_.READY,
662 'Trying to print when not in ready state: ' + this.uiState_); 664 'Trying to print when not in ready state: ' + this.uiState_);
663 this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/); 665 this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/);
664 e.preventDefault(); 666 e.preventDefault();
665 return; 667 return;
666 } 668 }
667 669
668 // Pass certain directional keyboard events to the PDF viewer. 670 // Pass certain directional keyboard events to the PDF viewer.
669 this.previewArea_.handleDirectionalKeyEvent(e); 671 this.previewArea_.handleDirectionalKeyEvent(e);
670 }, 672 },
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 <include src="search/recent_destination_list.js"/> 818 <include src="search/recent_destination_list.js"/>
817 <include src="search/destination_list_item.js"/> 819 <include src="search/destination_list_item.js"/>
818 <include src="search/destination_search.js"/> 820 <include src="search/destination_search.js"/>
819 <include src="search/search_box.js"/> 821 <include src="search/search_box.js"/>
820 <include src="search/fedex_tos.js"/> 822 <include src="search/fedex_tos.js"/>
821 823
822 window.addEventListener('DOMContentLoaded', function() { 824 window.addEventListener('DOMContentLoaded', function() {
823 printPreview = new print_preview.PrintPreview(); 825 printPreview = new print_preview.PrintPreview();
824 printPreview.initialize(); 826 printPreview.initialize();
825 }); 827 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698