| OLD | NEW |
| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Display error message. | 8 * Display error message. |
| 9 * @param {string} message Message id. | 9 * @param {string} message Message id. |
| 10 */ | 10 */ |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 document.ondragstart = function(e) { e.preventDefault() }; | 134 document.ondragstart = function(e) { e.preventDefault() }; |
| 135 | 135 |
| 136 chrome.fileBrowserPrivate.getStrings(function(strings) { | 136 chrome.fileBrowserPrivate.getStrings(function(strings) { |
| 137 loadTimeData.data = strings; | 137 loadTimeData.data = strings; |
| 138 | 138 |
| 139 controls = new FullWindowVideoControls( | 139 controls = new FullWindowVideoControls( |
| 140 document.querySelector('#video-player'), | 140 document.querySelector('#video-player'), |
| 141 document.querySelector('#video-container'), | 141 document.querySelector('#video-container'), |
| 142 document.querySelector('#controls')); | 142 document.querySelector('#controls')); |
| 143 | 143 |
| 144 metadataCache = MetadataCache.createFull(); | |
| 145 volumeManager = new VolumeManagerWrapper( | 144 volumeManager = new VolumeManagerWrapper( |
| 146 VolumeManagerWrapper.DriveEnabledStatus.DRIVE_ENABLED); | 145 VolumeManagerWrapper.DriveEnabledStatus.DRIVE_ENABLED); |
| 147 volumeManager.addEventListener('externally-unmounted', | 146 volumeManager.addEventListener('externally-unmounted', |
| 148 onExternallyUnmounted); | 147 onExternallyUnmounted); |
| 148 metadataCache = MetadataCache.createFull(volumeManager); |
| 149 | 149 |
| 150 // If the video player is starting before the first instance of the File | 150 // If the video player is starting before the first instance of the File |
| 151 // Manager then it does not have access to filesystem URLs. | 151 // Manager then it does not have access to filesystem URLs. |
| 152 // Request it now. | 152 // Request it now. |
| 153 volumeManager.ensureInitialized(reload); | 153 volumeManager.ensureInitialized(reload); |
| 154 var reloadVideo = function(e) { | 154 var reloadVideo = function(e) { |
| 155 if (decodeErrorOccured && | 155 if (decodeErrorOccured && |
| 156 // Ignore shortcut keys | 156 // Ignore shortcut keys |
| 157 !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { | 157 !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { |
| 158 reload(); | 158 reload(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 appWindow.resizeTo(newWidth, newHeight); | 280 appWindow.resizeTo(newWidth, newHeight); |
| 281 appWindow.moveTo(oldLeft - (newWidth - oldWidth) / 2, | 281 appWindow.moveTo(oldLeft - (newWidth - oldWidth) / 2, |
| 282 oldTop - (newHeight - oldHeight) / 2); | 282 oldTop - (newHeight - oldHeight) / 2); |
| 283 appWindow.show(); | 283 appWindow.show(); |
| 284 }); | 284 }); |
| 285 }); | 285 }); |
| 286 }); | 286 }); |
| 287 } | 287 } |
| 288 | 288 |
| 289 util.addPageLoadHandler(loadVideoPlayer); | 289 util.addPageLoadHandler(loadVideoPlayer); |
| OLD | NEW |