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

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

Issue 2678723002: Compile several targets in Gallery in gyp v2. (Closed)
Patch Set: Rebased. Created 3 years, 10 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 | « ui/file_manager/gallery/js/gallery.js ('k') | ui/file_manager/gallery/js/gallery_item.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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Dispatch an event. 77 // Dispatch an event.
78 var event = new Event('content'); 78 var event = new Event('content');
79 event.item = item; 79 event.item = item;
80 event.oldEntry = oldEntry; 80 event.oldEntry = oldEntry;
81 event.thumbnailChanged = true; 81 event.thumbnailChanged = true;
82 this.dispatchEvent(event); 82 this.dispatchEvent(event);
83 83
84 if (!util.isSameEntry(oldEntry, item.getEntry())) { 84 if (!util.isSameEntry(oldEntry, item.getEntry())) {
85 Promise.all([ 85 Promise.all([
86 this.metadataModel_.get( 86 this.metadataModel_.get(
87 [oldEntry], Gallery.PREFETCH_PROPERTY_NAMES), 87 [oldEntry], GalleryItem.PREFETCH_PROPERTY_NAMES),
88 new ThumbnailModel(this.metadataModel_).get([oldEntry]) 88 new ThumbnailModel(this.metadataModel_).get([oldEntry])
89 ]).then(function(itemLists) { 89 ]).then(function(itemLists) {
90 // New entry is added and the item now tracks it. 90 // New entry is added and the item now tracks it.
91 // Add another item for the old entry. 91 // Add another item for the old entry.
92 var anotherItem = new GalleryItem( 92 var anotherItem = new GalleryItem(
93 oldEntry, 93 oldEntry,
94 oldLocationInfo, 94 oldLocationInfo,
95 itemLists[0][0], 95 itemLists[0][0],
96 itemLists[1][0], 96 itemLists[1][0],
97 oldIsOriginal); 97 oldIsOriginal);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 * @private 142 * @private
143 */ 143 */
144 GalleryDataModel.prototype.onSplice_ = function(event) { 144 GalleryDataModel.prototype.onSplice_ = function(event) {
145 if (!event.removed || !event.removed.length) 145 if (!event.removed || !event.removed.length)
146 return; 146 return;
147 var removedURLs = event.removed.map(function(item) { 147 var removedURLs = event.removed.map(function(item) {
148 return item.getEntry().toURL(); 148 return item.getEntry().toURL();
149 }); 149 });
150 this.metadataModel_.notifyEntriesRemoved(removedURLs); 150 this.metadataModel_.notifyEntriesRemoved(removedURLs);
151 }; 151 };
OLDNEW
« no previous file with comments | « ui/file_manager/gallery/js/gallery.js ('k') | ui/file_manager/gallery/js/gallery_item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698