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 // If directory files changes too often, don't rescan directory more than once | 7 // If directory files changes too often, don't rescan directory more than once |
8 // per specified interval | 8 // per specified interval |
9 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; | 9 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; |
10 // Used for operations that require almost instant rescan. | 10 // Used for operations that require almost instant rescan. |
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 this.addEventListener('scan-completed', this.onSearchCompleted_); | 1314 this.addEventListener('scan-completed', this.onSearchCompleted_); |
1315 | 1315 |
1316 // If we are offline, let's fallback to file name search inside dir. | 1316 // If we are offline, let's fallback to file name search inside dir. |
1317 if (this.getCurrentRootType() === RootType.DRIVE && !this.isDriveOffline()) { | 1317 if (this.getCurrentRootType() === RootType.DRIVE && !this.isDriveOffline()) { |
1318 // Drive search is performed over the whole drive, so pass drive root as | 1318 // Drive search is performed over the whole drive, so pass drive root as |
1319 // |directoryEntry|. | 1319 // |directoryEntry|. |
1320 newDirContents = new DirectoryContentsDriveSearch( | 1320 newDirContents = new DirectoryContentsDriveSearch( |
1321 this.currentFileListContext_, | 1321 this.currentFileListContext_, |
1322 this.getCurrentDirEntry(), | 1322 this.getCurrentDirEntry(), |
1323 this.currentDirContents_.getLastNonSearchDirectoryEntry(), | 1323 this.currentDirContents_.getLastNonSearchDirectoryEntry(), |
1324 query, | 1324 query); |
1325 DirectoryContentsDriveSearch.SearchType.SEARCH_FULL); | |
1326 } else { | 1325 } else { |
1327 newDirContents = new DirectoryContentsLocalSearch( | 1326 newDirContents = new DirectoryContentsLocalSearch( |
1328 this.currentFileListContext_, this.getCurrentDirEntry(), query); | 1327 this.currentFileListContext_, this.getCurrentDirEntry(), query); |
1329 } | 1328 } |
1330 this.clearAndScan_(newDirContents); | 1329 this.clearAndScan_(newDirContents); |
1331 }; | 1330 }; |
1332 | 1331 |
1333 /** | 1332 /** |
1334 * Performs special search and displays results. e.g. Drive files available | 1333 * Performs special search and displays results. e.g. Drive files available |
1335 * offline, shared-with-me files, recently modified files. | 1334 * offline, shared-with-me files, recently modified files. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 }.bind(this)); | 1536 }.bind(this)); |
1538 } | 1537 } |
1539 }; | 1538 }; |
1540 | 1539 |
1541 /** | 1540 /** |
1542 * @return {DirectoryEntry} Current watched directory entry. | 1541 * @return {DirectoryEntry} Current watched directory entry. |
1543 */ | 1542 */ |
1544 FileWatcher.prototype.getWatchedDirectoryEntry = function() { | 1543 FileWatcher.prototype.getWatchedDirectoryEntry = function() { |
1545 return this.watchedDirectoryEntry_; | 1544 return this.watchedDirectoryEntry_; |
1546 }; | 1545 }; |
OLD | NEW |