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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js

Issue 130663002: Get rid of fullPath in the metadata cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/media/video_player.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js b/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js
index 0310b933d828aa7d8c101c9e60d503260880b8dd..bc724dab4bf0755e2c5f9bbeb70b1dcd8a371970 100644
--- a/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js
+++ b/chrome/browser/resources/file_manager/foreground/js/metadata/metadata_cache.js
@@ -108,12 +108,13 @@ MetadataCache.DESCENDANTS = 2;
MetadataCache.EVICTION_NUMBER = 1000;
/**
+ * @param {VolumeManagerWrapper} volumeManager Volume manager instance.
* @return {MetadataCache!} The cache with all providers.
*/
-MetadataCache.createFull = function() {
+MetadataCache.createFull = function(volumeManager) {
var cache = new MetadataCache();
cache.providers_.push(new FilesystemProvider());
- cache.providers_.push(new DriveProvider());
+ cache.providers_.push(new DriveProvider(volumeManager));
cache.providers_.push(new ContentProvider());
return cache;
};
@@ -671,11 +672,18 @@ FilesystemProvider.prototype.fetch = function(
* drive: { pinned, hosted, present, customIconUrl, etc. }
* thumbnail: { url, transform }
* streaming: { }
+ * @param {VolumeManagerWrapper} volumeManager Volume manager instance.
* @constructor
*/
-function DriveProvider() {
+function DriveProvider(volumeManager) {
MetadataProvider.call(this);
+ /**
+ * @type {VolumeManagerWrapper}
+ * @private
+ */
+ this.volumeManager_ = volumeManager;
+
// We batch metadata fetches into single API call.
this.entries_ = [];
this.callbacks_ = [];
@@ -693,8 +701,8 @@ DriveProvider.prototype = {
* @return {boolean} Whether this provider supports the entry.
*/
DriveProvider.prototype.supportsEntry = function(entry) {
- // TODO(mtomasz): Use Entry instead of paths.
- return PathUtil.isDriveBasedPath(entry.fullPath);
+ var locationInfo = this.volumeManager_.getLocationInfo(entry);
+ return locationInfo && locationInfo.isDriveBased;
};
/**
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/media/video_player.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698