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

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

Issue 1025613002: Fix ESC not closing the print preview dialog on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clearer logic Created 5 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 7bc676c66b8da44a1da303b80a6714f1ded01c11..cb2434132c14b50a53eecb3b43993f51cbd2ffa8 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -872,15 +872,12 @@ cr.define('print_preview', function() {
// Escape key closes the dialog.
if (e.keyCode == 27 && !e.shiftKey && !e.ctrlKey && !e.altKey &&
!e.metaKey) {
-<if expr="toolkit_views">
- // On the toolkit_views environment, ESC key is handled by C++-side
- // instead of JS-side.
- return;
-</if>
-<if expr="not toolkit_views">
- this.close_();
-</if>
- e.preventDefault();
+ // On non-mac with toolkit-views, ESC key is handled by C++-side instead
+ // of JS-side.
+ if (cr.isMac) {
+ this.close_();
+ 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