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

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

Issue 195763004: Reland of 260688: [Files.app] Use getDriveEntryProperties to retrieve metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adressed the comment Created 6 years, 9 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
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 64c424dfce7d993b1a2d4a9164c7656183a1f95c..9cabd05873c1fd99ee6770754d650651072bbdb4 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
@@ -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: (metadata.size || 0),
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';
};
/**
@@ -839,6 +841,11 @@ DriveProvider.prototype.convert_ = function(data, entry) {
shared: data.shared
};
+ result.filesystem = {
+ size: (entry.isFile ? (data.fileSize || 0) : -1),
hirono 2014/03/17 02:28:00 How about this line?
yoshiki 2014/03/17 04:06:15 Sorry, I was misunderstood and changed my mind. I
+ modificationTime: new Date(data.lastModifiedTime)
+ };
+
if (!data.isPresent) {
// Block the local fetch for drive files, which require downloading.
result.thumbnail = {url: '', transform: null};

Powered by Google App Engine
This is Rietveld 408576698