Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 {!MetadataCache} metadataCache Metadata cache. | 8 * @param {!MetadataCache} metadataCache Metadata cache. |
| 9 * @param {!MetadataModel} metadataModel | 9 * @param {!MetadataModel} metadataModel |
| 10 * @param {!EntryListWatcher=} opt_watcher Entry list watcher. | 10 * @param {!EntryListWatcher=} opt_watcher Entry list watcher. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 event.metadata = item.getMetadata(); | 94 event.metadata = item.getMetadata(); |
| 95 this.dispatchEvent(event); | 95 this.dispatchEvent(event); |
| 96 | 96 |
| 97 if (!util.isSameEntry(oldEntry, item.getEntry())) { | 97 if (!util.isSameEntry(oldEntry, item.getEntry())) { |
| 98 // New entry is added and the item now tracks it. | 98 // New entry is added and the item now tracks it. |
| 99 // Add another item for the old entry. | 99 // Add another item for the old entry. |
| 100 var anotherItem = new Gallery.Item( | 100 var anotherItem = new Gallery.Item( |
| 101 oldEntry, | 101 oldEntry, |
| 102 oldLocationInfo, | 102 oldLocationInfo, |
| 103 oldMetadata, | 103 oldMetadata, |
| 104 item.metadataItem_, | |
|
yawano
2015/03/03 04:14:50
Is this item.metadataItem_ updated for the new fil
hirono
2015/03/04 05:07:04
Actually this should be oldItemMetadata.
The behav
yawano
2015/03/04 05:20:45
I get it. Thank you!
| |
| 104 this.metadataCache_, | 105 this.metadataCache_, |
| 105 this.metadataModel_, | 106 this.metadataModel_, |
| 106 item.isOriginal()); | 107 item.isOriginal()); |
| 107 // The item must be added behind the existing item so that it does | 108 // The item must be added behind the existing item so that it does |
| 108 // not change the index of the existing item. | 109 // not change the index of the existing item. |
| 109 // TODO(hirono): Update the item index of the selection model | 110 // TODO(hirono): Update the item index of the selection model |
| 110 // correctly. | 111 // correctly. |
| 111 this.splice(this.indexOf(item) + 1, 0, anotherItem); | 112 this.splice(this.indexOf(item) + 1, 0, anotherItem); |
| 112 } | 113 } |
| 113 | 114 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 } else { | 149 } else { |
| 149 // Force to free the buffer of the canvas by assigning zero size. | 150 // Force to free the buffer of the canvas by assigning zero size. |
| 150 sorted[i].screenImage.width = 0; | 151 sorted[i].screenImage.width = 0; |
| 151 sorted[i].screenImage.height = 0; | 152 sorted[i].screenImage.height = 0; |
| 152 sorted[i].screenImage = null; | 153 sorted[i].screenImage = null; |
| 153 } | 154 } |
| 154 } | 155 } |
| 155 } | 156 } |
| 156 } | 157 } |
| 157 }; | 158 }; |
| OLD | NEW |