Chromium Code Reviews| Index: ui/file_manager/file_manager/foreground/js/quick_view_controller.js |
| diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js |
| index f2031bc2b7552b5d8c6a22105ec8d08c387e1930..f5e2e36955c339470862e6bba4e29b2e15af2825 100644 |
| --- a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js |
| +++ b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js |
| @@ -168,8 +168,10 @@ QuickViewController.prototype.updateQuickView_ = function() { |
| var entry = |
| (/** @type {!FileEntry} */ (this.quickViewModel_.getSelectedEntry())); |
| assert(entry); |
| - this.quickView_.filePath = entry.name; |
| - return this.metadataModel_.get([entry], ['contentThumbnailUrl']) |
| + return this.metadataModel_ |
| + .get( |
| + [entry], |
| + ['thumbnailUrl', 'contentThumbnailUrl', 'croppedThumbnailUrl']) |
|
fukino
2016/06/17 02:35:13
question: When do we need croppedThumbnailUrl?
fukino
2016/06/17 02:35:13
I don't remember the exact implementation, but if
oka
2016/06/17 23:13:54
Avoided to use contentThumbnailUrl for Drive files
oka
2016/06/17 23:13:54
It worked without croppedThumbnailUrl.
|
| .then(this.onMetadataLoaded_.bind(this, entry)); |
| }; |
| @@ -181,6 +183,8 @@ QuickViewController.prototype.updateQuickView_ = function() { |
| * @private |
| */ |
| QuickViewController.prototype.onMetadataLoaded_ = function(entry, items) { |
| + this.quickView_.clear(); |
| + this.quickView_.filePath = entry.name; |
| var item = items[0]; |
| var type = FileType.getType(entry); |
| var thumbnailUrl = item.thumbnailUrl || item.croppedThumbnailUrl; |
| @@ -189,7 +193,7 @@ QuickViewController.prototype.onMetadataLoaded_ = function(entry, items) { |
| // TODO(oka): Support Drive. |
| } else { |
| var url = thumbnailUrl || entry.toURL(); |
| - this.quickView_.setImageURL(url); |
| + this.quickView_.image = url; |
| } |
| } else if (type.type === 'video') { |
| // TODO(oka): Set thumbnail. |
| @@ -197,17 +201,18 @@ QuickViewController.prototype.onMetadataLoaded_ = function(entry, items) { |
| // TODO(oka): Support Drive. |
| } else { |
| var url = entry.toURL(); |
| - this.quickView_.setVideoURL(url); |
| + this.quickView_.video = url; |
| } |
| - this.quickView_.setVideoURL(entry.toURL()); |
| } else if (type.type === 'audio') { |
| - this.quickView_.setAudioURL(entry.toURL()); |
| - // TODO(oka): Set thumbnail. |
| if (item.externalFileUrl) { |
| // TODO(oka): Support Drive. |
| } else { |
| - this.quickView_.setAudioURL(url); |
| + var url = entry.toURL(); |
| + this.quickView_.audio = url; |
| } |
| - this.quickView_.setAudioURL(entry.toURL()); |
| + if (item.contentThumbnailUrl) |
| + this.quickView_.contentThumbnailUrl = item.contentThumbnailUrl; |
| + } else { |
| + this.quickView_.unsupported = true; |
| } |
| }; |