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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index 9aca1011579918c2ddbf3815ab47b5497073101c..8c1d3829d9acfc1df8870a15168f764b9ef2b283 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -769,9 +769,13 @@ cr.define('print_preview', function() {
!this.destinationSearch_.getIsVisible() &&
this.printTicketStore_.isTicketValid()) {
assert(this.uiState_ == PrintPreview.UiState_.READY,
- 'Trying to print when not in ready state: ' + this.uiState_);
- this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/);
- e.preventDefault();
+ 'Trying to print when not in ready state: ' + this.uiState_);
+ var activeElementTag = document.activeElement ?
+ document.activeElement.tagName.toUpperCase() : '';
+ if (activeElementTag != 'BUTTON' && activeElementTag != 'SELECT') {
+ this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/);
+ e.preventDefault();
+ }
return;
}
« 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