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

Unified Diff: chrome/browser/resources/md_history/app.crisper.js

Issue 2264933002: [MD History] Make sidebar menu respond to spacebar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_presubmit
Patch Set: use IronA11yKeysBehavior Created 4 years, 4 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
Index: chrome/browser/resources/md_history/app.crisper.js
diff --git a/chrome/browser/resources/md_history/app.crisper.js b/chrome/browser/resources/md_history/app.crisper.js
index b8422e555254173f9ef6d916297f45c6bd7ad7ab..94cbc690383600134d5c89c5966468a4f9c5ff05 100644
--- a/chrome/browser/resources/md_history/app.crisper.js
+++ b/chrome/browser/resources/md_history/app.crisper.js
@@ -8533,6 +8533,37 @@ Polymer({
});
Polymer({
+ is: 'iron-a11y-keys',
+ behaviors: [ Polymer.IronA11yKeysBehavior ],
+ properties: {
+ target: {
+ type: Object,
+ observer: '_targetChanged'
+ },
+ keys: {
+ type: String,
+ reflectToAttribute: true,
+ observer: '_keysChanged'
+ }
+ },
+ attached: function() {
+ if (!this.target) {
+ this.target = this.parentNode;
+ }
+ },
+ _targetChanged: function(target) {
+ this.keyEventTarget = target;
+ },
+ _keysChanged: function() {
+ this.removeOwnKeyBindings();
+ this.addOwnKeyBinding(this.keys, '_fireKeysPressed');
+ },
+ _fireKeysPressed: function(event) {
+ this.fire('keys-pressed', event.detail, {});
+ }
+});
+
+Polymer({
is: 'iron-selector',
behaviors: [ Polymer.IronMultiSelectableBehavior ]
});
@@ -8542,6 +8573,7 @@ Polymer({
// found in the LICENSE file.
Polymer({
is: 'history-side-bar',
+ behaviors: [ Polymer.IronA11yKeysBehavior ],
properties: {
selectedPage: {
type: String,
@@ -8554,6 +8586,12 @@ Polymer({
reflectToAttribute: true
}
},
+ keyBindings: {
+ 'space:keydown': 'onSpacePressed_'
+ },
+ onSpacePressed_: function(e) {
+ e.detail.keyboardEvent.path[0].click();
+ },
onSelectorActivate_: function() {
this.fire('history-close-drawer');
},

Powered by Google App Engine
This is Rietveld 408576698