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 function MockEventSource() { | 5 function MockEventSource() { |
6 this.listeners_ = []; | 6 this.listeners_ = []; |
7 } | 7 } |
8 | 8 |
9 /** | 9 /** |
10 * Add a listener. | 10 * Add a listener. |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 break; | 328 break; |
329 } | 329 } |
330 } | 330 } |
331 var notify = function(status) { | 331 var notify = function(status) { |
332 chrome.fileBrowserPrivate.onMountCompleted.notify({ | 332 chrome.fileBrowserPrivate.onMountCompleted.notify({ |
333 eventType: 'unmount', | 333 eventType: 'unmount', |
334 status: status, | 334 status: status, |
335 mountPath: mountPath, | 335 mountPath: mountPath, |
336 sourcePath: sourceUrl | 336 sourcePath: sourceUrl |
337 }); | 337 }); |
338 } | 338 }; |
339 | 339 |
340 window.webkitResolveLocalFileSystemURL(sourceUrl, function(entry) { | 340 window.webkitResolveLocalFileSystemURL(sourceUrl, function(entry) { |
341 util.removeFileOrDirectory( | 341 util.removeFileOrDirectory( |
342 entry, | 342 entry, |
343 util.flog('Deleted a mock mount at ' + entry.fullPath, | 343 util.flog('Deleted a mock mount at ' + entry.fullPath, |
344 notify.bind(null, 'success'), | 344 notify.bind(null, 'success'), |
345 util.flog('Error deleting a mock mount at' + entry.fullPath, | 345 util.flog('Error deleting a mock mount at' + entry.fullPath, |
346 notify))); | 346 notify))); |
347 }); | 347 }); |
348 }, | 348 }, |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 playAudio: function(urls, position) { | 874 playAudio: function(urls, position) { |
875 this.audioPlaylist_ = { items: urls, position: position }; | 875 this.audioPlaylist_ = { items: urls, position: position }; |
876 this.onPlaylistChanged.notify(); | 876 this.onPlaylistChanged.notify(); |
877 }, | 877 }, |
878 | 878 |
879 playVideo: function(url) { | 879 playVideo: function(url) { |
880 this.videoUrl_ = url; | 880 this.videoUrl_ = url; |
881 this.onVideoLaunched.notify(); | 881 this.onVideoLaunched.notify(); |
882 } | 882 } |
883 }; | 883 }; |
OLD | NEW |