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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/directory_contents.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 | « no previous file | chrome/browser/resources/file_manager/foreground/js/directory_model.js » ('j') | 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 /** 7 /**
8 * Scanner of the entries. 8 * Scanner of the entries.
9 * @constructor 9 * @constructor
10 */ 10 */
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 * Extends ContentScanner. 51 * Extends ContentScanner.
52 */ 52 */
53 DirectoryContentScanner.prototype.__proto__ = ContentScanner.prototype; 53 DirectoryContentScanner.prototype.__proto__ = ContentScanner.prototype;
54 54
55 /** 55 /**
56 * Starts to read the entries in the directory. 56 * Starts to read the entries in the directory.
57 * @override 57 * @override
58 */ 58 */
59 DirectoryContentScanner.prototype.scan = function( 59 DirectoryContentScanner.prototype.scan = function(
60 entriesCallback, successCallback, errorCallback) { 60 entriesCallback, successCallback, errorCallback) {
61 if (!this.entry_ || 61 if (!this.entry_ || util.isFakeEntry(this.entry_)) {
62 (util.isFakeEntry(this.entry_) &&
63 this.entry_.rootType === RootType.DRIVE)) {
64 // If entry is not specified or a fake, we cannot read it. 62 // If entry is not specified or a fake, we cannot read it.
65 errorCallback(util.createDOMError( 63 errorCallback(util.createDOMError(
66 util.FileError.INVALID_MODIFICATION_ERR)); 64 util.FileError.INVALID_MODIFICATION_ERR));
67 return; 65 return;
68 } 66 }
69 67
70 metrics.startInterval('DirectoryScan'); 68 metrics.startInterval('DirectoryScan');
71 var reader = this.entry_.createReader(); 69 var reader = this.entry_.createReader();
72 var readEntries = function() { 70 var readEntries = function() {
73 reader.readEntries( 71 reader.readEntries(
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 DirectoryContents.createForDriveMetadataSearch = function( 738 DirectoryContents.createForDriveMetadataSearch = function(
741 context, fakeDirectoryEntry, searchType) { 739 context, fakeDirectoryEntry, searchType) {
742 return new DirectoryContents( 740 return new DirectoryContents(
743 context, 741 context,
744 true, // Search 742 true, // Search
745 fakeDirectoryEntry, 743 fakeDirectoryEntry,
746 function() { 744 function() {
747 return new DriveMetadataSearchContentScanner(searchType); 745 return new DriveMetadataSearchContentScanner(searchType);
748 }); 746 });
749 }; 747 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/foreground/js/directory_model.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698