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

Unified Diff: ui/file_manager/file_manager/common/js/volume_manager_common.js

Issue 2622133008: mediaview: Implement UI. (Closed)
Patch Set: Fix typo and add logging. Created 3 years, 11 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/common/js/volume_manager_common.js
diff --git a/ui/file_manager/file_manager/common/js/volume_manager_common.js b/ui/file_manager/file_manager/common/js/volume_manager_common.js
index 03b72e43d5b50f6e1782edaa9c5ea308ed920517..2085eac67e05c40195c993a09019c9f87918f36d 100644
--- a/ui/file_manager/file_manager/common/js/volume_manager_common.js
+++ b/ui/file_manager/file_manager/common/js/volume_manager_common.js
@@ -54,7 +54,10 @@ VolumeManagerCommon.RootType = {
DRIVE_SHARED_WITH_ME: 'drive_shared_with_me',
// Fake root for recent files on the drive.
- DRIVE_RECENT: 'drive_recent'
+ DRIVE_RECENT: 'drive_recent',
+
+ // Root for media views.
+ MEDIA_VIEW: 'media_view',
};
Object.freeze(VolumeManagerCommon.RootType);
@@ -132,7 +135,8 @@ VolumeManagerCommon.VolumeType = {
REMOVABLE: 'removable',
ARCHIVE: 'archive',
MTP: 'mtp',
- PROVIDED: 'provided'
+ PROVIDED: 'provided',
+ MEDIA_VIEW: 'media_view',
};
/**
@@ -184,6 +188,8 @@ VolumeManagerCommon.getVolumeTypeFromRootType = function(rootType) {
return VolumeManagerCommon.VolumeType.MTP;
case VolumeManagerCommon.RootType.PROVIDED:
return VolumeManagerCommon.VolumeType.PROVIDED;
+ case VolumeManagerCommon.RootType.MEDIA_VIEW:
+ return VolumeManagerCommon.VolumeType.MEDIA_VIEW;
}
assertNotReached('Unknown root type: ' + rootType);
};
@@ -212,6 +218,31 @@ VolumeManagerCommon.VolumeInfoProvider = function() {};
VolumeManagerCommon.VolumeInfoProvider.prototype.getVolumeInfo;
/**
+ * List of media view root types.
+ *
+ * Keep this in sync with constants in arc_media_view_util.cc.
+ *
+ * @enum {string}
+ * @const
+ */
+VolumeManagerCommon.MediaViewRootType = {
+ IMAGES: 'images_root',
+ VIDEOS: 'videos_root',
+ AUDIO: 'audio_root',
+};
+Object.freeze(VolumeManagerCommon.MediaViewRootType);
+
+/**
+ * Obtains volume type from root type.
+ * @param {string} volumeId Volume ID.
+ * @return {VolumeManagerCommon.MediaViewRootType}
+ */
+VolumeManagerCommon.getMediaViewRootTypeFromVolumeId = function(volumeId) {
+ return /** @type {VolumeManagerCommon.MediaViewRootType} */ (
+ volumeId.split(':', 2)[1]);
+};
+
+/**
* Fake entries for Google Drive's virtual folders.
* (OFFLINE, RECENT, and SHARED_WITH_ME)
* @typedef {{
« no previous file with comments | « ui/file_manager/file_manager/common/js/util.js ('k') | ui/file_manager/file_manager/foreground/css/file_types.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698