| 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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 */ | 793 */ |
| 794 function initStrings(callback) { | 794 function initStrings(callback) { |
| 795 chrome.fileManagerPrivate.getStrings(function(strings) { | 795 chrome.fileManagerPrivate.getStrings(function(strings) { |
| 796 loadTimeData.data = strings; | 796 loadTimeData.data = strings; |
| 797 i18nTemplate.process(document, loadTimeData); | 797 i18nTemplate.process(document, loadTimeData); |
| 798 callback(); | 798 callback(); |
| 799 }.wrap(null)); | 799 }.wrap(null)); |
| 800 } | 800 } |
| 801 | 801 |
| 802 function initVolumeManager(callback) { | 802 function initVolumeManager(callback) { |
| 803 var volumeManager = new VolumeManagerWrapper(AllowedPaths.ANY_PATH); | 803 var volumeManager = new VolumeManagerWrapper(AllowedPaths.ANY_PATH, false); |
| 804 volumeManager.ensureInitialized(callback); | 804 volumeManager.ensureInitialized(callback); |
| 805 } | 805 } |
| 806 | 806 |
| 807 var initPromise = Promise.all( | 807 var initPromise = Promise.all( |
| 808 [new Promise(initStrings.wrap(null)), | 808 [new Promise(initStrings.wrap(null)), |
| 809 new Promise(initVolumeManager.wrap(null)), | 809 new Promise(initVolumeManager.wrap(null)), |
| 810 new Promise(util.addPageLoadHandler.wrap(null))]); | 810 new Promise(util.addPageLoadHandler.wrap(null))]); |
| 811 | 811 |
| 812 initPromise.then(function(unused) { | 812 initPromise.then(function(unused) { |
| 813 return new Promise(function(fulfill, reject) { | 813 return new Promise(function(fulfill, reject) { |
| 814 util.URLsToEntries(window.appState.items, function(entries) { | 814 util.URLsToEntries(window.appState.items, function(entries) { |
| 815 metrics.recordOpenVideoPlayerAction(); | 815 metrics.recordOpenVideoPlayerAction(); |
| 816 metrics.recordNumberOfOpenedFiles(entries.length); | 816 metrics.recordNumberOfOpenedFiles(entries.length); |
| 817 | 817 |
| 818 player.prepare(entries); | 818 player.prepare(entries); |
| 819 player.playFirstVideo(player, fulfill); | 819 player.playFirstVideo(player, fulfill); |
| 820 }.wrap()); | 820 }.wrap()); |
| 821 }.wrap()); | 821 }.wrap()); |
| 822 }.wrap()); | 822 }.wrap()); |
| OLD | NEW |