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

Side by Side Diff: ui/file_manager/audio_player/elements/audio_player.js

Issue 1994563002: Remove the use of KeyEvent.keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 4
5 Polymer({ 5 Polymer({
6 is: 'audio-player', 6 is: 'audio-player',
7 7
8 listeners: { 8 listeners: {
9 'toggle-pause-event': 'onTogglePauseEvent_', 9 'toggle-pause-event': 'onTogglePauseEvent_',
10 'small-forward-skip-event': 'onSmallForwardSkipEvent_', 10 'small-forward-skip-event': 'onSmallForwardSkipEvent_',
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 this.wasPlayingOnDragStart_ = false; 421 this.wasPlayingOnDragStart_ = false;
422 } 422 }
423 } 423 }
424 }, 424 },
425 425
426 /** 426 /**
427 * Invoked when the 'keydown' event is fired. 427 * Invoked when the 'keydown' event is fired.
428 * @param {Event} event The event object. 428 * @param {Event} event The event object.
429 */ 429 */
430 onKeyDown_: function(event) { 430 onKeyDown_: function(event) {
431 switch (event.keyIdentifier) { 431 switch (event.key) {
432 case 'MediaNextTrack': 432 case 'MediaTrackNext':
433 this.onControllerNextClicked(); 433 this.onControllerNextClicked();
434 break; 434 break;
435 case 'MediaPlayPause': 435 case 'MediaPlayPause':
436 this.playing = !this.playing; 436 this.playing = !this.playing;
437 break; 437 break;
438 case 'MediaPreviousTrack': 438 case 'MediaTrackPrevious':
439 this.onControllerPreviousClicked(); 439 this.onControllerPreviousClicked();
440 break; 440 break;
441 case 'MediaStop': 441 case 'MediaStop':
442 // TODO: Define "Stop" behavior. 442 // TODO: Define "Stop" behavior.
443 break; 443 break;
444 } 444 }
445 }, 445 },
446 446
447 /** 447 /**
448 * Computes volume value for audio element. (should be in [0.0, 1.0]) 448 * Computes volume value for audio element. (should be in [0.0, 1.0])
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 }, 486 },
487 487
488 /** 488 /**
489 * Big skip backword. 489 * Big skip backword.
490 * @private 490 * @private
491 */ 491 */
492 onBigBackwordSkipEvent_: function(event) { 492 onBigBackwordSkipEvent_: function(event) {
493 this.$.audioController.bigSkip(false); 493 this.$.audioController.bigSkip(false);
494 }, 494 },
495 }); 495 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698