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. There is no remove. | 10 * Add a listener. There is no remove. |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 chrome.fileBrowserPrivate.requestLocalFileSystem(function(filesystem) { | 230 chrome.fileBrowserPrivate.requestLocalFileSystem(function(filesystem) { |
231 var path = | 231 var path = |
232 (type == 'gdata') ? | 232 (type == 'gdata') ? |
233 '/gdata' : | 233 '/gdata' : |
234 ('/archive/archive' + (++chrome.fileBrowserPrivate.archiveCount_)); | 234 ('/archive/archive' + (++chrome.fileBrowserPrivate.archiveCount_)); |
235 util.getOrCreateDirectory(filesystem.root, path, function() { | 235 util.getOrCreateDirectory(filesystem.root, path, function() { |
236 chrome.fileBrowserPrivate.mountPoints_.push({ | 236 chrome.fileBrowserPrivate.mountPoints_.push({ |
237 mountPath: path, | 237 mountPath: path, |
238 type: type | 238 type: type |
239 }); | 239 }); |
240 chrome.fileBrowserPrivate.onMountCompleted.notify({ | 240 setTimeout(function() { |
241 eventType: 'mount', | 241 chrome.fileBrowserPrivate.onMountCompleted.notify({ |
242 status: 'success', | 242 eventType: 'mount', |
243 mountType: type, | 243 status: 'success', |
244 authToken: 'dummy', | 244 mountType: type, |
245 mountPath: path, | 245 authToken: 'dummy', |
246 sourceUrl: source | 246 mountPath: path, |
247 }); | 247 sourceUrl: source |
| 248 }); |
| 249 }, 1000); |
248 console.log('Created a mock mount at ' + path); | 250 console.log('Created a mock mount at ' + path); |
249 }, | 251 }, |
250 util.flog('Error creating a mock mount at ' + path)); | 252 util.flog('Error creating a mock mount at ' + path)); |
251 }); | 253 }); |
252 }, | 254 }, |
253 | 255 |
254 removeMount: function(sourceUrl) { | 256 removeMount: function(sourceUrl) { |
255 var mountPath = chrome.fileBrowserPrivate.fileUrlToLocalPath_(sourceUrl); | 257 var mountPath = chrome.fileBrowserPrivate.fileUrlToLocalPath_(sourceUrl); |
256 for (var i = 0; i != chrome.fileBrowserPrivate.mountPoints_.length; i++) { | 258 for (var i = 0; i != chrome.fileBrowserPrivate.mountPoints_.length; i++) { |
257 if (mountPath == chrome.fileBrowserPrivate.mountPoints_[i].mountPath) { | 259 if (mountPath == chrome.fileBrowserPrivate.mountPoints_[i].mountPath) { |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 | 664 |
663 setWindowHeight: function(height) { | 665 setWindowHeight: function(height) { |
664 this.popup_.style.height = height + 'px'; | 666 this.popup_.style.height = height + 'px'; |
665 }, | 667 }, |
666 | 668 |
667 closeWindow: function() { | 669 closeWindow: function() { |
668 this.popup_.parentNode.removeChild(this.popup_); | 670 this.popup_.parentNode.removeChild(this.popup_); |
669 this.popup_ = null; | 671 this.popup_ = null; |
670 } | 672 } |
671 }; | 673 }; |
OLD | NEW |