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

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

Issue 971653003: Files.app: Extract cache part from NewMetadataProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix audio player. Created 5 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
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/directory_model.js » ('j') | 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 * @const 8 * @const
9 */ 9 */
10 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js'; 10 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js';
11 11
12 /** 12 /**
13 * @param {HTMLElement} container Container element. 13 * @param {HTMLElement} container Container element.
14 * @constructor 14 * @constructor
15 */ 15 */
16 function AudioPlayer(container) { 16 function AudioPlayer(container) {
17 this.container_ = container; 17 this.container_ = container;
18 this.volumeManager_ = new VolumeManagerWrapper( 18 this.volumeManager_ = new VolumeManagerWrapper(
19 VolumeManagerWrapper.DriveEnabledStatus.DRIVE_ENABLED); 19 VolumeManagerWrapper.DriveEnabledStatus.DRIVE_ENABLED);
20 this.fileSystemMetadata_ = FileSystemMetadata.create( 20 this.fileSystemMetadata_ = new FileSystemMetadata(this.volumeManager_);
21 new MetadataProviderCache(), this.volumeManager_);
22 this.selectedEntry_ = null; 21 this.selectedEntry_ = null;
23 22
24 this.model_ = new AudioPlayerModel(); 23 this.model_ = new AudioPlayerModel();
25 var observer = new PathObserver(this.model_, 'expanded'); 24 var observer = new PathObserver(this.model_, 'expanded');
26 observer.open(function(newValue, oldValue) { 25 observer.open(function(newValue, oldValue) {
27 // Inverse arguments intentionally to match the Polymer way. 26 // Inverse arguments intentionally to match the Polymer way.
28 this.onModelExpandedChanged(oldValue, newValue); 27 this.onModelExpandedChanged(oldValue, newValue);
29 }.bind(this)); 28 }.bind(this));
30 29
31 this.entries_ = []; 30 this.entries_ = [];
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // TODO(yoshiki): Handle error in better way. 424 // TODO(yoshiki): Handle error in better way.
426 // TODO(yoshiki): implement artwork (metadata.thumbnail) 425 // TODO(yoshiki): implement artwork (metadata.thumbnail)
427 this.title = metadata.mediaTitle || this.getDefaultTitle(); 426 this.title = metadata.mediaTitle || this.getDefaultTitle();
428 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); 427 this.artist = error || metadata.mediaArtist || this.getDefaultArtist();
429 }; 428 };
430 429
431 // Starts loading the audio player. 430 // Starts loading the audio player.
432 window.addEventListener('polymer-ready', function(e) { 431 window.addEventListener('polymer-ready', function(e) {
433 AudioPlayer.load(); 432 AudioPlayer.load();
434 }); 433 });
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/directory_model.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698