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

Unified Diff: ui/file_manager/file_manager/foreground/js/quick_view_controller.js

Issue 2074953002: Quick View: Initial implementation of "No preview availale" and UI update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
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..5c2fbb456ac217b5ef4e1f2aca305c6bd7cfb51d 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,7 @@ 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', 'externalFileUrl'])
.then(this.onMetadataLoaded_.bind(this, entry));
};
@@ -181,15 +180,17 @@ 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;
+ var thumbnailUrl = item.thumbnailUrl;
if (type.type === 'image') {
if (item.externalFileUrl) {
// 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 +198,23 @@ 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.metadataModel_.get([entry], ['contentThumbnailUrl'])
+ .then(function(entry, items) {
+ var item = items[0];
+ if (item.contentThumbnailUrl)
+ this.quickView_.contentThumbnailUrl =
+ item.contentThumbnailUrl;
+ }.bind(this, entry));
}
- this.quickView_.setAudioURL(entry.toURL());
+ } else {
+ this.quickView_.unsupported = true;
}
};
« no previous file with comments | « ui/file_manager/file_manager/foreground/elements/files_quick_view.js ('k') | ui/file_manager/file_manager_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698