Commit ca54e156 authored by mtomasz's avatar mtomasz Committed by Commit bot

[fsp] Move thumbnail logic to Drive specific C++ code.

MetadataCache is soon going to be generalized from Drive to also FSP file
systems. So, in the Files app layer, we should not have Drive specific code.

TEST=Tested manually.
BUG=408017

Review URL: https://codereview.chromium.org/517213002

Cr-Commit-Position: refs/heads/master@{#292829}
parent 69782daa
...@@ -71,7 +71,10 @@ void FillDriveEntryPropertiesValue(const drive::ResourceEntry& entry_proto, ...@@ -71,7 +71,10 @@ void FillDriveEntryPropertiesValue(const drive::ResourceEntry& entry_proto,
const drive::FileSpecificInfo& file_specific_info = const drive::FileSpecificInfo& file_specific_info =
entry_proto.file_specific_info(); entry_proto.file_specific_info();
if (!entry_proto.resource_id().empty()) { // The web thumbnail is used only when the file is not present. Otherwise
// it could be out of sync.
if (!entry_proto.resource_id().empty() &&
!file_specific_info.cache_state().is_present()) {
properties->thumbnail_url.reset( properties->thumbnail_url.reset(
new std::string("https://www.googledrive.com/thumb/" + new std::string("https://www.googledrive.com/thumb/" +
entry_proto.resource_id() + "?width=500&height=500")); entry_proto.resource_id() + "?width=500&height=500"));
......
...@@ -49,13 +49,6 @@ function ThumbnailLoader(entry, opt_loaderType, opt_metadata, opt_mediaType, ...@@ -49,13 +49,6 @@ function ThumbnailLoader(entry, opt_loaderType, opt_metadata, opt_mediaType,
}; };
} }
// If the file is on the drive and it is present, the file may be out of sync
// drive's thumbnail. So we don't use it.
if (opt_metadata.drive && opt_metadata.drive.present) {
opt_metadata = MetadataCache.cloneMetadata(opt_metadata);
opt_metadata.thumbnail = null;
}
if (opt_metadata.thumbnail && opt_metadata.thumbnail.url && if (opt_metadata.thumbnail && opt_metadata.thumbnail.url &&
opt_useEmbedded === ThumbnailLoader.UseEmbedded.USE_EMBEDDED) { opt_useEmbedded === ThumbnailLoader.UseEmbedded.USE_EMBEDDED) {
this.thumbnailUrl_ = opt_metadata.thumbnail.url; this.thumbnailUrl_ = opt_metadata.thumbnail.url;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment