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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/photo/ribbon.js

Issue 109973002: Migrate from URLs to Entries in the Files App's gallery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years 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: chrome/browser/resources/file_manager/foreground/js/photo/ribbon.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/photo/ribbon.js b/chrome/browser/resources/file_manager/foreground/js/photo/ribbon.js
index 04ec68e020cc6bc88204d1aaea8df8480fc8ea80..1259b17d1a0d88ccbd80039d01b4d24dc40feb6d 100644
--- a/chrome/browser/resources/file_manager/foreground/js/photo/ribbon.js
+++ b/chrome/browser/resources/file_manager/foreground/js/photo/ribbon.js
@@ -107,7 +107,7 @@ Ribbon.prototype.onSplice_ = function(event) {
return;
}
- var removed = this.renderCache_[event.removed[0].getUrl()];
+ var removed = this.renderCache_[event.removed[0].getEntry().toURL()];
if (!removed || !removed.parentNode || !removed.hasAttribute('selected')) {
console.error('Can only remove the selected item');
return;
@@ -248,7 +248,7 @@ Ribbon.prototype.onSelection_ = function() {
if (oldSelected) oldSelected.removeAttribute('selected');
var newSelected =
- this.renderCache_[this.dataModel_.item(selectedIndex).getUrl()];
+ this.renderCache_[this.dataModel_.item(selectedIndex).getEntry().toURL()];
if (newSelected) newSelected.setAttribute('selected', true);
};
@@ -291,7 +291,7 @@ Ribbon.prototype.removeVanishing_ = function() {
*/
Ribbon.prototype.renderThumbnail_ = function(index) {
var item = this.dataModel_.item(index);
- var url = item.getUrl();
+ var url = item.getEntry().toURL();
var cached = this.renderCache_[url];
if (cached) {
@@ -311,7 +311,7 @@ Ribbon.prototype.renderThumbnail_ = function(index) {
util.createChild(thumbnail, 'image-wrapper');
- this.metadataCache_.get(url, Gallery.METADATA_TYPE,
+ this.metadataCache_.get(item.getEntry().toURL(), Gallery.METADATA_TYPE,
this.setThumbnailImage_.bind(this, thumbnail, url));
// TODO: Implement LRU eviction.
@@ -343,7 +343,7 @@ Ribbon.prototype.setThumbnailImage_ = function(thumbnail, url, metadata) {
* @private
*/
Ribbon.prototype.onContentChange_ = function(event) {
- var url = event.item.getUrl();
+ var url = event.item.getEntry().toURL();
this.remapCache_(event.oldUrl, url);
var thumbnail = this.renderCache_[url];

Powered by Google App Engine
This is Rietveld 408576698