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

Unified Diff: ui/file_manager/gallery/js/gallery.js

Issue 384413002: Gallery.app: Do not create images for each operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | ui/file_manager/gallery/js/gallery_item.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/gallery.js
diff --git a/ui/file_manager/gallery/js/gallery.js b/ui/file_manager/gallery/js/gallery.js
index 67caf43afb4c9f60fb762fdddbb8bd702967eb1a..55dfe636b445286392660e686cce9a5e32225e15 100644
--- a/ui/file_manager/gallery/js/gallery.js
+++ b/ui/file_manager/gallery/js/gallery.js
@@ -56,8 +56,9 @@ GalleryDataModel.prototype.initialize = function(metadataCache, entries) {
// Obtains items.
var items = entries.map(function(entry, i) {
+ var clonedMetadata = MetadataCache.cloneMetadata(metadata[i]);
return new Gallery.Item(
- entry, MetadataCache.cloneMetadata(metadata[i]), metadataCache);
+ entry, clonedMetadata, metadataCache, /* original */ true);
});
// Update the models.
@@ -119,7 +120,7 @@ GalleryDataModel.prototype.saveItem = function(item, canvas, overwrite) {
// New entry is added and the item now tracks it.
// Add another item for the old entry.
var anotherItem = new Gallery.Item(
- oldEntry, oldMetadata, this.metadataCache_);
+ oldEntry, oldMetadata, this.metadataCache_, item.isOriginal());
// The item must be added behind the existing item so that it does
// not change the index of the existing item.
// TODO(hirono): Update the item index of the selection model
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/gallery_item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698