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

Unified Diff: chrome/browser/resources/ntp4/apps_page.js

Issue 1431103003: Chrome Apps Page: Fixed issue with app focusing and context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: chrome/browser/resources/ntp4/apps_page.js
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js
index 8136080e00827767e1f94f2f4a2b825a27229f52..647ec829aa081be7bdb179617d92426367706d68 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -295,7 +295,7 @@ cr.define('ntp', function() {
this.addEventListener('mousedown', this.onMousedown_, true);
this.addEventListener('keydown', this.onKeydown_);
- this.addEventListener('keyup', this.onKeyup_);
+ this.addEventListener('blur', this.onBlur_);
},
/**
@@ -378,6 +378,11 @@ cr.define('ntp', function() {
this.style.top = toCssPx(y);
},
+ onBlur_: function(e) {
+ this.classList.remove('click-focus');
+ this.appContents_.classList.remove('suppress-active');
+ },
+
/**
* Invoked when an app is clicked.
* @param {Event} e The click event.
@@ -410,33 +415,6 @@ cr.define('ntp', function() {
e.preventDefault();
e.stopPropagation();
}
- this.onKeyboardUsed_(e.keyCode);
- },
-
- /**
- * Invoked when the user releases a key while the app is focused.
- * @param {Event} e The key event.
- * @private
- */
- onKeyup_: function(e) {
- this.onKeyboardUsed_(e.keyCode);
- },
-
- /**
- * Called when the keyboard has been used (key down or up). The .click-focus
- * hack is removed if the user presses a key that can change focus.
- * @param {number} keyCode The key code of the keyboard event.
- * @private
- */
- onKeyboardUsed_: function(keyCode) {
- switch (keyCode) {
- case 9: // Tab.
- case 37: // Left arrow.
- case 38: // Up arrow.
- case 39: // Right arrow.
- case 40: // Down arrow.
- this.classList.remove('click-focus');
- }
},
/**
« no previous file with comments | « no previous file | chrome/browser/resources/ntp4/tile_page.js » ('j') | chrome/browser/resources/ntp4/tile_page.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698