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

Side by Side Diff: ui/file_manager/gallery/js/gallery_data_model.js

Issue 1362873003: Gallery: keep exif info if image is saved to a copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failed test case. Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/gallery_data_model_unittest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Data model for gallery. 6 * Data model for gallery.
7 * 7 *
8 * @param {!MetadataModel} metadataModel 8 * @param {!MetadataModel} metadataModel
9 * @param {!EntryListWatcher=} opt_watcher Entry list watcher. 9 * @param {!EntryListWatcher=} opt_watcher Entry list watcher.
10 * @constructor 10 * @constructor
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 */ 65 */
66 GalleryDataModel.prototype.saveItem = function( 66 GalleryDataModel.prototype.saveItem = function(
67 volumeManager, item, canvas, overwrite) { 67 volumeManager, item, canvas, overwrite) {
68 var oldEntry = item.getEntry(); 68 var oldEntry = item.getEntry();
69 var oldLocationInfo = item.getLocationInfo(); 69 var oldLocationInfo = item.getLocationInfo();
70 var oldIsOriginal = item.isOriginal(); 70 var oldIsOriginal = item.isOriginal();
71 return new Promise(function(fulfill, reject) { 71 return new Promise(function(fulfill, reject) {
72 item.saveToFile( 72 item.saveToFile(
73 volumeManager, 73 volumeManager,
74 this.metadataModel_, 74 this.metadataModel_,
75 this.fallbackSaveDirectory, 75 assert(this.fallbackSaveDirectory),
76 canvas, 76 canvas,
77 overwrite, 77 overwrite,
78 function(success) { 78 function(success) {
79 if (!success) { 79 if (!success) {
80 reject('Failed to save the image.'); 80 reject('Failed to save the image.');
81 return; 81 return;
82 } 82 }
83 83
84 // Current entry is updated. 84 // Current entry is updated.
85 // Dispatch an event. 85 // Dispatch an event.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 * @private 162 * @private
163 */ 163 */
164 GalleryDataModel.prototype.onSplice_ = function(event) { 164 GalleryDataModel.prototype.onSplice_ = function(event) {
165 if (!event.removed || !event.removed.length) 165 if (!event.removed || !event.removed.length)
166 return; 166 return;
167 var removedURLs = event.removed.map(function(item) { 167 var removedURLs = event.removed.map(function(item) {
168 return item.getEntry().toURL(); 168 return item.getEntry().toURL();
169 }); 169 });
170 this.metadataModel_.notifyEntriesRemoved(removedURLs); 170 this.metadataModel_.notifyEntriesRemoved(removedURLs);
171 }; 171 };
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/gallery_data_model_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698