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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 function PromiseResolver() { 4 function PromiseResolver() {
5 this.resolve_; 5 this.resolve_;
6 this.reject_; 6 this.reject_;
7 this.promise_ = new Promise(function(resolve, reject) { 7 this.promise_ = new Promise(function(resolve, reject) {
8 this.resolve_ = resolve; 8 this.resolve_ = resolve;
9 this.reject_ = reject; 9 this.reject_ = reject;
10 }.bind(this)); 10 }.bind(this));
(...skipping 8515 matching lines...) Expand 10 before | Expand all | Expand 10 after
8526 } 8526 }
8527 this.fetchingSyncedTabs_ = true; 8527 this.fetchingSyncedTabs_ = true;
8528 }, 8528 },
8529 searchTermChanged: function(searchTerm) { 8529 searchTermChanged: function(searchTerm) {
8530 this.clearDisplayedSyncedDevices_(); 8530 this.clearDisplayedSyncedDevices_();
8531 this.updateSyncedDevices(this.sessionList); 8531 this.updateSyncedDevices(this.sessionList);
8532 } 8532 }
8533 }); 8533 });
8534 8534
8535 Polymer({ 8535 Polymer({
8536 is: 'iron-a11y-keys',
8537 behaviors: [ Polymer.IronA11yKeysBehavior ],
8538 properties: {
8539 target: {
8540 type: Object,
8541 observer: '_targetChanged'
8542 },
8543 keys: {
8544 type: String,
8545 reflectToAttribute: true,
8546 observer: '_keysChanged'
8547 }
8548 },
8549 attached: function() {
8550 if (!this.target) {
8551 this.target = this.parentNode;
8552 }
8553 },
8554 _targetChanged: function(target) {
8555 this.keyEventTarget = target;
8556 },
8557 _keysChanged: function() {
8558 this.removeOwnKeyBindings();
8559 this.addOwnKeyBinding(this.keys, '_fireKeysPressed');
8560 },
8561 _fireKeysPressed: function(event) {
8562 this.fire('keys-pressed', event.detail, {});
8563 }
8564 });
8565
8566 Polymer({
8536 is: 'iron-selector', 8567 is: 'iron-selector',
8537 behaviors: [ Polymer.IronMultiSelectableBehavior ] 8568 behaviors: [ Polymer.IronMultiSelectableBehavior ]
8538 }); 8569 });
8539 8570
8540 // Copyright 2016 The Chromium Authors. All rights reserved. 8571 // Copyright 2016 The Chromium Authors. All rights reserved.
8541 // Use of this source code is governed by a BSD-style license that can be 8572 // Use of this source code is governed by a BSD-style license that can be
8542 // found in the LICENSE file. 8573 // found in the LICENSE file.
8543 Polymer({ 8574 Polymer({
8544 is: 'history-side-bar', 8575 is: 'history-side-bar',
8576 behaviors: [ Polymer.IronA11yKeysBehavior ],
8545 properties: { 8577 properties: {
8546 selectedPage: { 8578 selectedPage: {
8547 type: String, 8579 type: String,
8548 notify: true 8580 notify: true
8549 }, 8581 },
8550 route: Object, 8582 route: Object,
8551 showFooter: Boolean, 8583 showFooter: Boolean,
8552 drawer: { 8584 drawer: {
8553 type: Boolean, 8585 type: Boolean,
8554 reflectToAttribute: true 8586 reflectToAttribute: true
8555 } 8587 }
8556 }, 8588 },
8589 keyBindings: {
8590 'space:keydown': 'onSpacePressed_'
8591 },
8592 onSpacePressed_: function(e) {
8593 e.detail.keyboardEvent.path[0].click();
8594 },
8557 onSelectorActivate_: function() { 8595 onSelectorActivate_: function() {
8558 this.fire('history-close-drawer'); 8596 this.fire('history-close-drawer');
8559 }, 8597 },
8560 onClearBrowsingDataTap_: function(e) { 8598 onClearBrowsingDataTap_: function(e) {
8561 var browserService = md_history.BrowserService.getInstance(); 8599 var browserService = md_history.BrowserService.getInstance();
8562 browserService.recordAction('InitClearBrowsingData'); 8600 browserService.recordAction('InitClearBrowsingData');
8563 browserService.openClearBrowsingData(); 8601 browserService.openClearBrowsingData();
8564 e.preventDefault(); 8602 e.preventDefault();
8565 }, 8603 },
8566 getQueryString_: function(route) { 8604 getQueryString_: function(route) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
8758 8796
8759 case HistoryRange.MONTH: 8797 case HistoryRange.MONTH:
8760 histogramValue = HistoryPageViewHistogram.GROUPED_MONTH; 8798 histogramValue = HistoryPageViewHistogram.GROUPED_MONTH;
8761 break; 8799 break;
8762 } 8800 }
8763 break; 8801 break;
8764 } 8802 }
8765 md_history.BrowserService.getInstance().recordHistogram('History.HistoryPage View', histogramValue, HistoryPageViewHistogram.END); 8803 md_history.BrowserService.getInstance().recordHistogram('History.HistoryPage View', histogramValue, HistoryPageViewHistogram.END);
8766 } 8804 }
8767 }); 8805 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698