Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/directory_model.js

Issue 166443008: Files.app: Use createDirectoryContents_ method during search. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/directory_contents.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 onClearSearch) { 836 onClearSearch) {
837 this.clearSearch_(); 837 this.clearSearch_();
838 var currentDirEntry = this.getCurrentDirEntry(); 838 var currentDirEntry = this.getCurrentDirEntry();
839 if (!currentDirEntry) { 839 if (!currentDirEntry) {
840 // Not yet initialized. Do nothing. 840 // Not yet initialized. Do nothing.
841 return; 841 return;
842 } 842 }
843 843
844 if (!(query || '').trimLeft()) { 844 if (!(query || '').trimLeft()) {
845 if (this.isSearching()) { 845 if (this.isSearching()) {
846 var newDirContents = DirectoryContents.createForDirectory( 846 var newDirContents = this.createDirectoryContents_(
847 this.currentFileListContext_, 847 this.currentFileListContext_,
848 currentDirEntry); 848 currentDirEntry);
849 this.clearAndScan_(newDirContents); 849 this.clearAndScan_(newDirContents);
850 } 850 }
851 return; 851 return;
852 } 852 }
853 853
854 var newDirContents = this.createDirectoryContents_( 854 var newDirContents = this.createDirectoryContents_(
855 this.currentFileListContext_, currentDirEntry, query); 855 this.currentFileListContext_, currentDirEntry, query);
856 if (!newDirContents) 856 if (!newDirContents)
(...skipping 17 matching lines...) Expand all
874 if (this.onSearchCompleted_) { 874 if (this.onSearchCompleted_) {
875 this.removeEventListener('scan-completed', this.onSearchCompleted_); 875 this.removeEventListener('scan-completed', this.onSearchCompleted_);
876 this.onSearchCompleted_ = null; 876 this.onSearchCompleted_ = null;
877 } 877 }
878 878
879 if (this.onClearSearch_) { 879 if (this.onClearSearch_) {
880 this.onClearSearch_(); 880 this.onClearSearch_();
881 this.onClearSearch_ = null; 881 this.onClearSearch_ = null;
882 } 882 }
883 }; 883 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/directory_contents.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698