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

Unified Diff: chrome/browser/resources/print_preview/print_header.js

Issue 10778041: Makes dialog print on ENTER key press. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/print_header.js
diff --git a/chrome/browser/resources/print_preview/print_header.js b/chrome/browser/resources/print_preview/print_header.js
index 059fb05d26fdd43e1c2a9c7def9317a5cca8f386..59edff20b6e5e7406f56a3d2416af8a178354782 100644
--- a/chrome/browser/resources/print_preview/print_header.js
+++ b/chrome/browser/resources/print_preview/print_header.js
@@ -69,6 +69,7 @@ cr.define('print_preview', function() {
this.cancelButton_.disabled = !isEnabled;
},
+ /** @param {string} message Error message to display in the print header. */
setErrorMessage: function(message) {
var summaryEl = this.getElement().getElementsByClassName(
PrintHeader.Classes_.SUMMARY)[0];
@@ -79,7 +80,6 @@ cr.define('print_preview', function() {
/** @override */
enterDocument: function() {
print_preview.Component.prototype.enterDocument.call(this);
- this.printButton_.focus();
// User events
this.tracker.add(
@@ -220,6 +220,7 @@ cr.define('print_preview', function() {
} else {
this.printButton_.textContent = localStrings.getString('printButton');
}
+ this.printButton_.focus();
},
/**
@@ -232,6 +233,10 @@ cr.define('print_preview', function() {
!this.printTicketStore_.isTicketValid() ||
!this.isEnabled_;
this.updateSummary_();
+ if (document.activeElement == null ||
+ document.activeElement == document.body) {
+ this.printButton_.focus();
+ }
}
};
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698