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

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

Issue 1581933004: Audio Player: Close the player on Ctrl-W. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Overrided metadata worker's path. 6 * Overrided metadata worker's path.
7 * @type {string} 7 * @type {string}
8 */ 8 */
9 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js'; 9 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js';
10 10
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 }; 320 };
321 321
322 /** 322 /**
323 * Handles keydown event to open inspector with shortcut keys. 323 * Handles keydown event to open inspector with shortcut keys.
324 * 324 *
325 * @param {Event} event KeyDown event. 325 * @param {Event} event KeyDown event.
326 * @private 326 * @private
327 */ 327 */
328 AudioPlayer.prototype.onKeyDown_ = function(event) { 328 AudioPlayer.prototype.onKeyDown_ = function(event) {
329 switch (util.getKeyModifiers(event) + event.keyIdentifier) { 329 switch (util.getKeyModifiers(event) + event.keyIdentifier) {
330 case 'Ctrl-U+0057': // Ctrl+W => Close the player.
331 chrome.app.window.current().close();
332 break;
333
330 // Handle debug shortcut keys. 334 // Handle debug shortcut keys.
331 case 'Ctrl-Shift-U+0049': // Ctrl+Shift+I 335 case 'Ctrl-Shift-U+0049': // Ctrl+Shift+I
332 chrome.fileManagerPrivate.openInspector('normal'); 336 chrome.fileManagerPrivate.openInspector('normal');
333 break; 337 break;
334 case 'Ctrl-Shift-U+004A': // Ctrl+Shift+J 338 case 'Ctrl-Shift-U+004A': // Ctrl+Shift+J
335 chrome.fileManagerPrivate.openInspector('console'); 339 chrome.fileManagerPrivate.openInspector('console');
336 break; 340 break;
337 case 'Ctrl-Shift-U+0043': // Ctrl+Shift+C 341 case 'Ctrl-Shift-U+0043': // Ctrl+Shift+C
338 chrome.fileManagerPrivate.openInspector('element'); 342 chrome.fileManagerPrivate.openInspector('element');
339 break; 343 break;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // TODO(yoshiki): Handle error in better way. 482 // TODO(yoshiki): Handle error in better way.
479 // TODO(yoshiki): implement artwork (metadata.thumbnail) 483 // TODO(yoshiki): implement artwork (metadata.thumbnail)
480 this.title = metadata.mediaTitle || this.getDefaultTitle(); 484 this.title = metadata.mediaTitle || this.getDefaultTitle();
481 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); 485 this.artist = error || metadata.mediaArtist || this.getDefaultArtist();
482 }; 486 };
483 487
484 // Starts loading the audio player. 488 // Starts loading the audio player.
485 window.addEventListener('DOMContentLoaded', function(e) { 489 window.addEventListener('DOMContentLoaded', function(e) {
486 AudioPlayer.load(); 490 AudioPlayer.load();
487 }); 491 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698