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

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

Issue 189543003: Let buttons and select controls in Print Preview to handle Enter key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 this.openSystemPrintDialog_(); 762 this.openSystemPrintDialog_();
763 e.preventDefault(); 763 e.preventDefault();
764 return; 764 return;
765 } 765 }
766 } 766 }
767 767
768 if (e.keyCode == 13 /*enter*/ && 768 if (e.keyCode == 13 /*enter*/ &&
769 !this.destinationSearch_.getIsVisible() && 769 !this.destinationSearch_.getIsVisible() &&
770 this.printTicketStore_.isTicketValid()) { 770 this.printTicketStore_.isTicketValid()) {
771 assert(this.uiState_ == PrintPreview.UiState_.READY, 771 assert(this.uiState_ == PrintPreview.UiState_.READY,
772 'Trying to print when not in ready state: ' + this.uiState_); 772 'Trying to print when not in ready state: ' + this.uiState_);
773 this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/); 773 var activeElementTag = document.activeElement ?
774 e.preventDefault(); 774 document.activeElement.tagName.toUpperCase() : '';
775 if (activeElementTag != 'BUTTON' && activeElementTag != 'SELECT') {
776 this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/);
777 e.preventDefault();
778 }
775 return; 779 return;
776 } 780 }
777 781
778 // Pass certain directional keyboard events to the PDF viewer. 782 // Pass certain directional keyboard events to the PDF viewer.
779 this.previewArea_.handleDirectionalKeyEvent(e); 783 this.previewArea_.handleDirectionalKeyEvent(e);
780 }, 784 },
781 785
782 /** 786 /**
783 * Called when native layer receives invalid settings for a print request. 787 * Called when native layer receives invalid settings for a print request.
784 * @private 788 * @private
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 <include src="search/recent_destination_list.js"/> 996 <include src="search/recent_destination_list.js"/>
993 <include src="search/destination_list_item.js"/> 997 <include src="search/destination_list_item.js"/>
994 <include src="search/destination_search.js"/> 998 <include src="search/destination_search.js"/>
995 <include src="search/search_box.js"/> 999 <include src="search/search_box.js"/>
996 <include src="search/fedex_tos.js"/> 1000 <include src="search/fedex_tos.js"/>
997 1001
998 window.addEventListener('DOMContentLoaded', function() { 1002 window.addEventListener('DOMContentLoaded', function() {
999 printPreview = new print_preview.PrintPreview(); 1003 printPreview = new print_preview.PrintPreview();
1000 printPreview.initialize(); 1004 printPreview.initialize();
1001 }); 1005 });
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