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

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

Issue 10796094: Merge 147143 - Makes dialog print on ENTER key press. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
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
===================================================================
--- chrome/browser/resources/print_preview/print_header.js (revision 147897)
+++ chrome/browser/resources/print_preview/print_header.js (working copy)
@@ -69,6 +69,7 @@
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 @@
/** @override */
enterDocument: function() {
print_preview.Component.prototype.enterDocument.call(this);
- this.printButton_.focus();
// User events
this.tracker.add(
@@ -220,6 +220,7 @@
} else {
this.printButton_.textContent = localStrings.getString('printButton');
}
+ this.printButton_.focus();
},
/**
@@ -232,6 +233,10 @@
!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