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

Unified Diff: ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js

Issue 256023002: Reland of r266437: [Files.app] Use getDriveEntryProperties() to retrieve metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/common/extensions/api/file_browser_private.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
index b86fb357d3e1197dcd57e10a4cc1ebc023302d27..6ec44299481687eeed4a897fd036811a9aa94cb7 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
@@ -115,8 +115,10 @@ MetadataCache.EVICTION_THRESHOLD_MARGIN = 500;
*/
MetadataCache.createFull = function(volumeManager) {
var cache = new MetadataCache();
- cache.providers_.push(new FilesystemProvider());
+ // DriveProvider should be prior to FileSystemProvider, because it covers
+ // FileSystemProvider for files in Drive.
cache.providers_.push(new DriveProvider(volumeManager));
+ cache.providers_.push(new FilesystemProvider());
cache.providers_.push(new ContentProvider());
return cache;
};
@@ -681,7 +683,7 @@ FilesystemProvider.prototype.fetch = function(
function onMetadata(entry, metadata) {
callback({
filesystem: {
- size: entry.isFile ? (metadata.size || 0) : -1,
+ size: (entry.isFile ? (metadata.size || 0) : -1),
modificationTime: metadata.modificationTime
}
});
@@ -735,7 +737,7 @@ DriveProvider.prototype.supportsEntry = function(entry) {
*/
DriveProvider.prototype.providesType = function(type) {
return type === 'drive' || type === 'thumbnail' ||
- type === 'streaming' || type === 'media';
+ type === 'streaming' || type === 'media' || type === 'filesystem';
};
/**
@@ -838,6 +840,11 @@ DriveProvider.prototype.convert_ = function(data, entry) {
shared: data.shared
};
+ result.filesystem = {
+ size: (entry.isFile ? (data.fileSize || 0) : -1),
+ modificationTime: new Date(data.lastModifiedTime)
+ };
+
if ('thumbnailUrl' in data) {
result.thumbnail = {
url: data.thumbnailUrl,
« no previous file with comments | « chrome/common/extensions/api/file_browser_private.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698