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 /** | 7 /** |
8 * This class manages filters and determines a file should be shown or not. | 8 * This class manages filters and determines a file should be shown or not. |
9 * When filters are changed, a 'changed' event is fired. | 9 * When filters are changed, a 'changed' event is fired. |
10 * | 10 * |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
820 this.lastChunkReceived(); | 820 this.lastChunkReceived(); |
821 return; | 821 return; |
822 } | 822 } |
823 this.done_ = true; | 823 this.done_ = true; |
824 | 824 |
825 var entries = results.map(function(r) { return r.entry; }); | 825 var entries = results.map(function(r) { return r.entry; }); |
826 this.onNewEntries(entries); | 826 this.onNewEntries(entries); |
827 this.lastChunkReceived(); | 827 this.lastChunkReceived(); |
828 }).bind(this); | 828 }).bind(this); |
829 | 829 |
830 var types = 'ALL'; | 830 var types; |
831 switch (this.searchType_) { | 831 switch (this.searchType_) { |
832 case DirectoryContentsDriveSearchMetadata.SearchType.SEARCH_ALL: | 832 case DirectoryContentsDriveSearchMetadata.SearchType.SEARCH_ALL: |
833 types = 'ALL'; | 833 types = 'ALL'; |
834 break; | 834 break; |
835 case DirectoryContentsDriveSearchMetadata.SearchType.SEARCH_SHARED_WITH_ME: | 835 case DirectoryContentsDriveSearchMetadata.SearchType.SEARCH_SHARED_WITH_ME: |
836 types = 'SHARED_WITH_ME'; | 836 types = 'SHARED_WITH_ME'; |
837 break; | |
not at google - send to devlin
2013/04/10 03:58:02
then add a "default: throw Error()" case?
Haruki Sato
2013/04/10 04:01:18
Done. Thanks!
| |
837 } | 838 } |
838 // TODO(haruki): Pass the search type when searchDriveMetadata support is | 839 var searchParams = { |
839 // implemented. | 840 'query': this.query_, |
840 // var searchParams = { | 841 'types': types, |
841 // 'query': this.query_, | 842 'maxResults': 500 |
842 // 'types': types, | 843 }; |
843 // 'maxResults': 500, | 844 chrome.fileBrowserPrivate.searchDriveMetadata(searchParams, searchCallback); |
844 // }; | |
845 chrome.fileBrowserPrivate.searchDriveMetadata(this.query_, searchCallback); | |
846 }; | 845 }; |
847 | 846 |
848 /** | 847 /** |
849 * DirectoryContents to list Drive files available offline. The search is done | 848 * DirectoryContents to list Drive files available offline. The search is done |
850 * by traversing the directory tree under "My Drive" and filtering them using | 849 * by traversing the directory tree under "My Drive" and filtering them using |
851 * the availableOffline property in 'drive' metadata. | 850 * the availableOffline property in 'drive' metadata. |
852 * @param {FileListContext} context File list context. | 851 * @param {FileListContext} context File list context. |
853 * @param {DirectoryEntry} driveDirEntry Directory for actual Drive. Traversal | 852 * @param {DirectoryEntry} driveDirEntry Directory for actual Drive. Traversal |
854 * starts from this Entry. Should be null if underlying Drive is not | 853 * starts from this Entry. Should be null if underlying Drive is not |
855 * available. | 854 * available. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
986 }.bind(this); | 985 }.bind(this); |
987 | 986 |
988 getNextChunk(); | 987 getNextChunk(); |
989 }; | 988 }; |
990 | 989 |
991 /** | 990 /** |
992 * Everything is done in scanDirectory_(). | 991 * Everything is done in scanDirectory_(). |
993 */ | 992 */ |
994 DirectoryContentsDriveOffline.prototype.readNextChunk = function() { | 993 DirectoryContentsDriveOffline.prototype.readNextChunk = function() { |
995 }; | 994 }; |
OLD | NEW |