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

Unified Diff: ui/file_manager/file_manager/foreground/elements/files_metadata_box.js

Issue 2109563002: Quick View: Add more metadata and update UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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/elements/files_metadata_box.js
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.js b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.js
index e74e7b50e754d8220d8b887f2967903f3fd5be94..9040b37a80b49d94af598ef1971330001db74c06 100644
--- a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.js
+++ b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.js
@@ -6,18 +6,84 @@ var FilesMetadataBox = Polymer({
is: 'files-metadata-box',
properties: {
+ // File media type, e.g. image, video.
+ type: String,
size: String,
modiifcationTime: String,
- /*
- * TODO(oka): Add the following fields.
- * filePath: String,
- * imageWidth: Number,
- * imageHeight: Number,
- * mediaTitle: String,
- * mediaArtist: String,
- * mediaMimeType: String,
- */
+ filePath: String,
+ mediaMimeType: String,
+
+ // File type specific metadata below.
+ imageWidth: Number,
+ imageHeight: Number,
+ mediaTitle: String,
+ mediaArtist: String,
},
-});
+ // Clears fields.
+ clear: function() {
+ this.type = '';
+ this.size = '';
+ this.modiifcationTime = '';
+ this.mediaMimeType = '';
+ this.filePath = '';
+
+ this.imageWidth = 0;
+ this.imageHeight = 0;
+ this.mediaTitle = '';
+ this.mediaArtist = '';
+ },
+
+ /**
+ * @param {string} type
+ * @return {boolean}
+ *
+ * @private
+ */
+ isImage_: function(type) { return type === 'image'; },
+
+ /**
+ * @param {string} type
+ * @return {boolean}
+ *
+ * @private
+ */
+ isVideo_: function(type) { return type === 'video'; },
+ /**
+ * @param {string} type
+ * @return {boolean}
+ *
+ * @private
+ */
+ isAudio_: function(type) { return type === 'audio'; },
+
+ /**
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ * @param {string} mediaTitle
+ * @param {string} mediaArtist
+ * @return {boolean}
+ *
+ * @private
+ */
+ hasFileSpecificInfo_: function(
+ imageWidth, imageHeight, mediaTitle, mediaArtist) {
+ var result = (imageWidth && imageHeight) || mediaTitle || mediaArtist;
+ return !!result;
+ },
+
+ /**
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ * @return {string}
+ *
+ * @private
+ */
+ resolution_: function(imageWidth, imageHeight) {
+ if (imageWidth && imageHeight)
+ return imageWidth + " x " + imageHeight;
+ return '';
+ },
+
+});

Powered by Google App Engine
This is Rietveld 408576698