OLD | NEW |
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 /** | 5 /** |
6 * @param {!HTMLElement} playerContainer Main container. | 6 * @param {!HTMLElement} playerContainer Main container. |
7 * @param {!HTMLElement} videoContainer Container for the video element. | 7 * @param {!HTMLElement} videoContainer Container for the video element. |
8 * @param {!HTMLElement} controlsContainer Container for video controls. | 8 * @param {!HTMLElement} controlsContainer Container for video controls. |
9 * @constructor | 9 * @constructor |
10 * @struct | 10 * @struct |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 */ | 685 */ |
686 function initStrings(callback) { | 686 function initStrings(callback) { |
687 chrome.fileManagerPrivate.getStrings(function(strings) { | 687 chrome.fileManagerPrivate.getStrings(function(strings) { |
688 loadTimeData.data = strings; | 688 loadTimeData.data = strings; |
689 i18nTemplate.process(document, loadTimeData); | 689 i18nTemplate.process(document, loadTimeData); |
690 callback(); | 690 callback(); |
691 }.wrap(null)); | 691 }.wrap(null)); |
692 } | 692 } |
693 | 693 |
694 function initVolumeManager(callback) { | 694 function initVolumeManager(callback) { |
695 var volumeManager = new VolumeManagerWrapper( | 695 var volumeManager = new VolumeManagerWrapper(AllowedPaths.ANY_PATH); |
696 VolumeManagerWrapper.NonNativeVolumeStatus.ENABLED); | |
697 volumeManager.ensureInitialized(callback); | 696 volumeManager.ensureInitialized(callback); |
698 } | 697 } |
699 | 698 |
700 var initPromise = Promise.all( | 699 var initPromise = Promise.all( |
701 [new Promise(initStrings.wrap(null)), | 700 [new Promise(initStrings.wrap(null)), |
702 new Promise(initVolumeManager.wrap(null)), | 701 new Promise(initVolumeManager.wrap(null)), |
703 new Promise(util.addPageLoadHandler.wrap(null))]); | 702 new Promise(util.addPageLoadHandler.wrap(null))]); |
704 | 703 |
705 initPromise.then(function(unused) { | 704 initPromise.then(function(unused) { |
706 return new Promise(function(fulfill, reject) { | 705 return new Promise(function(fulfill, reject) { |
707 util.URLsToEntries(window.appState.items, function(entries) { | 706 util.URLsToEntries(window.appState.items, function(entries) { |
708 metrics.recordOpenVideoPlayerAction(); | 707 metrics.recordOpenVideoPlayerAction(); |
709 metrics.recordNumberOfOpenedFiles(entries.length); | 708 metrics.recordNumberOfOpenedFiles(entries.length); |
710 | 709 |
711 player.prepare(entries); | 710 player.prepare(entries); |
712 player.playFirstVideo(player, fulfill); | 711 player.playFirstVideo(player, fulfill); |
713 }.wrap()); | 712 }.wrap()); |
714 }.wrap()); | 713 }.wrap()); |
715 }.wrap()); | 714 }.wrap()); |
OLD | NEW |