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

Side by Side Diff: chrome/browser/resources/file_manager/js/directory_contents.js

Issue 10914075: [filemanager] Implementing undo delete functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Merge to head Created 8 years, 3 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
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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {MetadataCache} metadataCache Metadata cache service. 7 * @param {MetadataCache} metadataCache Metadata cache service.
8 * @param {cr.ui.ArrayDataModel} fileList The file list. 8 * @param {cr.ui.ArrayDataModel} fileList The file list.
9 * @param {boolean} showHidden If files starting with '.' are shown. 9 * @param {boolean} showHidden If files starting with '.' are shown.
10 */ 10 */
11 function FileListContext(metadataCache, fileList, showHidden) { 11 function FileListContext(metadataCache, fileList, showHidden) {
12 /** 12 /**
13 * @type {MetadataCache} 13 * @type {MetadataCache}
14 */ 14 */
15 this.metadataCache = metadataCache; 15 this.metadataCache = metadataCache;
16 /** 16 /**
17 * @type {cr.ui.ArrayDataModel} 17 * @type {cr.ui.ArrayDataModel}
18 */ 18 */
19 this.fileList = fileList; 19 this.fileList = fileList;
20 /** 20 /**
21 * @type Object.<string, Function> 21 * @type Object.<string, Function>
22 * @private 22 * @private
23 */ 23 */
24 this.filters_ = {}; 24 this.filters_ = {};
25 this.setFilterHidden(!showHidden); 25 this.setFilterHidden(!showHidden);
26
27 // Do not show entries marked as 'deleted'.
28 this.addFilter('deleted', function(entry) {
29 var internal = this.metadataCache.getCached(entry, 'internal');
30 return !(internal && internal.deleted);
31 }.bind(this));
26 } 32 }
27 33
28 /** 34 /**
29 * @param {string} name Filter identifier. 35 * @param {string} name Filter identifier.
30 * @param {Function(Entry)} callback A filter — a function receiving an Entry, 36 * @param {Function(Entry)} callback A filter — a function receiving an Entry,
31 * and returning bool. 37 * and returning bool.
32 */ 38 */
33 FileListContext.prototype.addFilter = function(name, callback) { 39 FileListContext.prototype.addFilter = function(name, callback) {
34 this.filters_[name] = callback; 40 this.filters_[name] = callback;
35 }; 41 };
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 }.bind(this); 593 }.bind(this);
588 594
589 getNextChunk(); 595 getNextChunk();
590 }; 596 };
591 597
592 /** 598 /**
593 * We get results for each directory in one go in scanDirectory_. 599 * We get results for each directory in one go in scanDirectory_.
594 */ 600 */
595 DirectoryContentsLocalSearch.prototype.readNextChunk = function() { 601 DirectoryContentsLocalSearch.prototype.readNextChunk = function() {
596 }; 602 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/butter_bar.js ('k') | chrome/browser/resources/file_manager/js/directory_model.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698