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

Side by Side Diff: chrome/browser/resources/file_manager/js/media/audio_player.js

Issue 12381076: Files.app: Disables browser shortcut keys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * @param {HTMLElement} container Container element. 6 * @param {HTMLElement} container Container element.
7 * @constructor 7 * @constructor
8 */ 8 */
9 function AudioPlayer(container) { 9 function AudioPlayer(container) {
10 this.container_ = container; 10 this.container_ = container;
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 */ 574 */
575 function FullWindowAudioControls(container, advanceTrack, onError) { 575 function FullWindowAudioControls(container, advanceTrack, onError) {
576 AudioControls.apply(this, arguments); 576 AudioControls.apply(this, arguments);
577 577
578 document.addEventListener('keydown', function(e) { 578 document.addEventListener('keydown', function(e) {
579 if (e.keyIdentifier == 'U+0020') { 579 if (e.keyIdentifier == 'U+0020') {
580 this.togglePlayState(); 580 this.togglePlayState();
581 e.preventDefault(); 581 e.preventDefault();
582 } 582 }
583 }.bind(this)); 583 }.bind(this));
584
585 util.disableBrowserShortcutKeys(document);
584 } 586 }
585 587
586 FullWindowAudioControls.prototype = { __proto__: AudioControls.prototype }; 588 FullWindowAudioControls.prototype = { __proto__: AudioControls.prototype };
587 589
588 /** 590 /**
589 * Enable play state restore from the location hash. 591 * Enable play state restore from the location hash.
590 * @param {string} src Source URL. 592 * @param {string} src Source URL.
591 * @param {boolean} restore True if need to restore the play state. 593 * @param {boolean} restore True if need to restore the play state.
592 */ 594 */
593 FullWindowAudioControls.prototype.load = function(src, restore) { 595 FullWindowAudioControls.prototype.load = function(src, restore) {
(...skipping 13 matching lines...) Expand all
607 * Restore the state after page/app reload. 609 * Restore the state after page/app reload.
608 */ 610 */
609 FullWindowAudioControls.prototype.restorePlayState = function() { 611 FullWindowAudioControls.prototype.restorePlayState = function() {
610 if (this.restoreWhenLoaded_) { 612 if (this.restoreWhenLoaded_) {
611 this.restoreWhenLoaded_ = false; // This should only work once. 613 this.restoreWhenLoaded_ = false; // This should only work once.
612 if (this.decodeState()) 614 if (this.decodeState())
613 return; 615 return;
614 } 616 }
615 this.play(); 617 this.play();
616 }; 618 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698