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

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

Issue 2640673002: (WIP) Use generator to generate externs for chrome.fileManagerPrivate API.
Patch Set: Compile passes Created 3 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
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 * @private 363 * @private
364 */ 364 */
365 AudioPlayer.prototype.onKeyDown_ = function(event) { 365 AudioPlayer.prototype.onKeyDown_ = function(event) {
366 switch (util.getKeyModifiers(event) + event.key) { 366 switch (util.getKeyModifiers(event) + event.key) {
367 case 'Ctrl-w': // Ctrl+W => Close the player. 367 case 'Ctrl-w': // Ctrl+W => Close the player.
368 chrome.app.window.current().close(); 368 chrome.app.window.current().close();
369 break; 369 break;
370 370
371 // Handle debug shortcut keys. 371 // Handle debug shortcut keys.
372 case 'Ctrl-Shift-I': // Ctrl+Shift+I 372 case 'Ctrl-Shift-I': // Ctrl+Shift+I
373 chrome.fileManagerPrivate.openInspector('normal'); 373 chrome.fileManagerPrivate.openInspector(
374 chrome.fileManagerPrivate.InspectionType.NORMAL);
374 break; 375 break;
375 case 'Ctrl-Shift-J': // Ctrl+Shift+J 376 case 'Ctrl-Shift-J': // Ctrl+Shift+J
376 chrome.fileManagerPrivate.openInspector('console'); 377 chrome.fileManagerPrivate.openInspector(
378 chrome.fileManagerPrivate.InspectionType.CONSOLE);
377 break; 379 break;
378 case 'Ctrl-Shift-C': // Ctrl+Shift+C 380 case 'Ctrl-Shift-C': // Ctrl+Shift+C
379 chrome.fileManagerPrivate.openInspector('element'); 381 chrome.fileManagerPrivate.openInspector(
382 chrome.fileManagerPrivate.InspectionType.ELEMENT);
380 break; 383 break;
381 case 'Ctrl-Shift-B': // Ctrl+Shift+B 384 case 'Ctrl-Shift-B': // Ctrl+Shift+B
382 chrome.fileManagerPrivate.openInspector('background'); 385 chrome.fileManagerPrivate.openInspector(
386 chrome.fileManagerPrivate.InspectionType.BACKGROUND);
383 break; 387 break;
384 388
385 case ' ': // Space 389 case ' ': // Space
386 case 'k': 390 case 'k':
387 this.player_.dispatchEvent(new Event('toggle-pause-event')); 391 this.player_.dispatchEvent(new Event('toggle-pause-event'));
388 break; 392 break;
389 case 'ArrowUp': 393 case 'ArrowUp':
390 case 'ArrowRight': 394 case 'ArrowRight':
391 if (event.target.id !== 'volumeSlider') 395 if (event.target.id !== 'volumeSlider')
392 this.player_.dispatchEvent(new Event('small-forward-skip-event')); 396 this.player_.dispatchEvent(new Event('small-forward-skip-event'));
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 // TODO(yoshiki): Handle error in better way. 625 // TODO(yoshiki): Handle error in better way.
622 this.title = metadata.mediaTitle || this.getDefaultTitle(); 626 this.title = metadata.mediaTitle || this.getDefaultTitle();
623 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); 627 this.artist = error || metadata.mediaArtist || this.getDefaultArtist();
624 this.artworkUrl = metadata.contentThumbnailUrl || ""; 628 this.artworkUrl = metadata.contentThumbnailUrl || "";
625 }; 629 };
626 630
627 // Starts loading the audio player. 631 // Starts loading the audio player.
628 window.addEventListener('DOMContentLoaded', function(e) { 632 window.addEventListener('DOMContentLoaded', function(e) {
629 AudioPlayer.load(); 633 AudioPlayer.load();
630 }); 634 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698