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 // Setting the src of an img to an empty string can crash the browser, so we | 5 // Setting the src of an img to an empty string can crash the browser, so we |
6 // use an empty 1x1 gif instead. | 6 // use an empty 1x1 gif instead. |
7 | 7 |
8 /** | 8 /** |
9 * FileManager constructor. | 9 * FileManager constructor. |
10 * | 10 * |
(...skipping 3452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3463 } | 3463 } |
3464 chrome.fileBrowserPrivate.removeFileWatch(this.watchedDirectoryUrl_, | 3464 chrome.fileBrowserPrivate.removeFileWatch(this.watchedDirectoryUrl_, |
3465 function(result) { | 3465 function(result) { |
3466 if (!result) { | 3466 if (!result) { |
3467 console.log('Failed to remove file watch'); | 3467 console.log('Failed to remove file watch'); |
3468 } | 3468 } |
3469 }); | 3469 }); |
3470 this.watchedDirectoryUrl_ = null; | 3470 this.watchedDirectoryUrl_ = null; |
3471 } | 3471 } |
3472 | 3472 |
3473 if (event.newDirEntry.fullPath != '/' && | 3473 if (event.newDirEntry.fullPath != '/') { |
3474 DirectoryModel.getRootType(event.newDirEntry.fullPath) != | |
3475 DirectoryModel.GDATA_DIRECTORY) { | |
3476 // Currently file watchers do not work on GData. When they start working | |
3477 // we should be careful not to watch GData before it is mounted. | |
3478 this.watchedDirectoryUrl_ = event.newDirEntry.toURL(); | 3474 this.watchedDirectoryUrl_ = event.newDirEntry.toURL(); |
3479 chrome.fileBrowserPrivate.addFileWatch(this.watchedDirectoryUrl_, | 3475 chrome.fileBrowserPrivate.addFileWatch(this.watchedDirectoryUrl_, |
3480 function(result) { | 3476 function(result) { |
3481 if (!result) { | 3477 if (!result) { |
3482 console.log('Failed to add file watch'); | 3478 console.log('Failed to add file watch'); |
3483 this.watchedDirectoryUrl_ = null; | 3479 this.watchedDirectoryUrl_ = null; |
3484 } | 3480 } |
3485 }.bind(this)); | 3481 }.bind(this)); |
3486 } | 3482 } |
3487 | 3483 |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4283 }); | 4279 }); |
4284 }, onError); | 4280 }, onError); |
4285 | 4281 |
4286 function onError(err) { | 4282 function onError(err) { |
4287 console.log('Error while checking free space: ' + err); | 4283 console.log('Error while checking free space: ' + err); |
4288 setTimeout(doCheck, 1000 * 60); | 4284 setTimeout(doCheck, 1000 * 60); |
4289 } | 4285 } |
4290 } | 4286 } |
4291 } | 4287 } |
4292 })(); | 4288 })(); |
OLD | NEW |