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

Unified Diff: ui/file_manager/file_manager/foreground/js/media/media_util.js

Issue 310433004: Gallery.app: Update thumbnail when a file is edited on the photo editor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: ui/file_manager/file_manager/foreground/js/media/media_util.js
diff --git a/ui/file_manager/file_manager/foreground/js/media/media_util.js b/ui/file_manager/file_manager/foreground/js/media/media_util.js
index aa7d0dfec4a0cd68df2d2c7362f6554754bf3e72..5d57852d247096f6994e5a1010f619275dc66174 100644
--- a/ui/file_manager/file_manager/foreground/js/media/media_util.js
+++ b/ui/file_manager/file_manager/foreground/js/media/media_util.js
@@ -49,6 +49,13 @@ 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 &&
opt_useEmbedded === ThumbnailLoader.UseEmbedded.USE_EMBEDDED) {
this.thumbnailUrl_ = opt_metadata.thumbnail.url;
@@ -181,6 +188,14 @@ ThumbnailLoader.prototype.load = function(box, fillMode, opt_optimizationMode,
this.metadata_.filesystem &&
this.metadata_.filesystem.modificationTime &&
this.metadata_.filesystem.modificationTime.getTime();
+
+ // If the file is on the drive, the modificationTime is inaccurate.
+ // If the drive.present is true, the file may be editted on the local, so we
+ // need to force to update of the file.
mtomasz 2014/06/02 06:40:28 Please note that this is a workaround for a bug. I
hirono 2014/06/02 08:59:15 I changed the code so that the app invalidates the
+ if (this.metadata_ && this.metadata_.drive && this.metadata_.drive.present) {
+ modificationTime = Date.now();
+ }
+
this.taskId_ = util.loadImage(
this.image_,
this.thumbnailUrl_,

Powered by Google App Engine
This is Rietveld 408576698