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 // If directory files changes too often, don't rescan directory more than once | 5 // If directory files changes too often, don't rescan directory more than once |
6 // per specified interval | 6 // per specified interval |
7 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; | 7 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; |
8 // Used for operations that require almost instant rescan. | 8 // Used for operations that require almost instant rescan. |
9 var SHORT_RESCAN_INTERVAL = 100; | 9 var SHORT_RESCAN_INTERVAL = 100; |
10 | 10 |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 function onScanComplete() { | 763 function onScanComplete() { |
764 if (opt_callback) | 764 if (opt_callback) |
765 opt_callback(); | 765 opt_callback(); |
766 // For tests that open the dialog to empty directories, everything | 766 // For tests that open the dialog to empty directories, everything |
767 // is loaded at this point. | 767 // is loaded at this point. |
768 chrome.test.sendMessage('directory-change-complete'); | 768 chrome.test.sendMessage('directory-change-complete'); |
769 } | 769 } |
770 this.clearAndScan_(new DirectoryContentsBasic(this.currentFileListContext_, | 770 this.clearAndScan_(new DirectoryContentsBasic(this.currentFileListContext_, |
771 dirEntry), | 771 dirEntry), |
772 onScanComplete.bind(this)); | 772 onScanComplete.bind(this)); |
| 773 this.currentDirByRoot_[this.getCurrentRootPath()] = dirEntry.fullPath; |
773 this.updateRootsListSelection_(); | 774 this.updateRootsListSelection_(); |
774 this.currentDirByRoot_[this.getCurrentRootPath()] = dirEntry.fullPath; | |
775 }; | 775 }; |
776 | 776 |
777 /** | 777 /** |
778 * Change the current directory to the directory represented by a | 778 * Change the current directory to the directory represented by a |
779 * DirectoryEntry. | 779 * DirectoryEntry. |
780 * | 780 * |
781 * Dispatches the 'directory-changed' event when the directory is successfully | 781 * Dispatches the 'directory-changed' event when the directory is successfully |
782 * changed. | 782 * changed. |
783 * | 783 * |
784 * @private | 784 * @private |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 }.bind(this)); | 1404 }.bind(this)); |
1405 } | 1405 } |
1406 }; | 1406 }; |
1407 | 1407 |
1408 /** | 1408 /** |
1409 * @return {DirectoryEntry} Current watched directory entry. | 1409 * @return {DirectoryEntry} Current watched directory entry. |
1410 */ | 1410 */ |
1411 FileWatcher.prototype.getWatchedDirectoryEntry = function() { | 1411 FileWatcher.prototype.getWatchedDirectoryEntry = function() { |
1412 return this.watchedDirectoryEntry_; | 1412 return this.watchedDirectoryEntry_; |
1413 }; | 1413 }; |
OLD | NEW |