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

Unified Diff: ui/file_manager/file_manager/background/js/mock_volume_manager.js

Issue 2839863002: Add Team Drive subtree to the directory list view. (Closed)
Patch Set: Remove some unncecesary code Created 3 years, 8 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/background/js/mock_volume_manager.js
diff --git a/ui/file_manager/file_manager/background/js/mock_volume_manager.js b/ui/file_manager/file_manager/background/js/mock_volume_manager.js
index 04882df4fc6d556bc29de9b812d1e2cd7fbefb14..d6e747ca9f8ef13cf09ad7d5f0fd6f2eb85fab93 100644
--- a/ui/file_manager/file_manager/background/js/mock_volume_manager.js
+++ b/ui/file_manager/file_manager/background/js/mock_volume_manager.js
@@ -74,15 +74,27 @@ MockVolumeManager.prototype.getVolumeInfo = function(entry) {
*/
MockVolumeManager.prototype.getLocationInfo = function(entry) {
if (util.isFakeEntry(entry)) {
- return new EntryLocationImpl(this.volumeInfoList.item(0), entry.rootType,
- true, true);
+ return new EntryLocationImpl(
+ this.volumeInfoList.item(0), entry.rootType, true, true);
}
if (entry.filesystem.name === VolumeManagerCommon.VolumeType.DRIVE) {
var volumeInfo = this.volumeInfoList.item(0);
- var isRootEntry = entry.fullPath === '/root';
- return new EntryLocationImpl(volumeInfo, VolumeManagerCommon.RootType.DRIVE,
- isRootEntry, true);
+ var roootType;
+ var isRootEntry;
+ if (entry.fullPath.startsWith('/team_drives')) {
+ if (entry.fullPath === '/team_drives') {
+ rootType = VolumeManagerCommon.RootType.TEAM_DRIVES_GRAND_ROOT;
+ isRootEntry = true;
+ } else {
+ rootType = VolumeManagerCommon.RootType.TEAM_DRIVE;
+ isRootEntry = util.isTeamDriveRoot(entry);
+ }
+ } else {
+ rootType = VolumeManagerCommon.RootType.DRIVE;
+ isRootEntry = entry.fullPath === '/root';
+ }
+ return new EntryLocationImpl(volumeInfo, rootType, isRootEntry, true);
}
throw new Error('Not implemented exception.');
@@ -208,14 +220,26 @@ MockVolumeManagerWrapper.prototype.getVolumeInfo = function(entry) {
*/
MockVolumeManagerWrapper.prototype.getLocationInfo = function(entry) {
if (util.isFakeEntry(entry)) {
- return new EntryLocationImpl(this.volumeInfoList.item(0), entry.rootType,
- true, true);
+ return new EntryLocationImpl(
+ this.volumeInfoList.item(0), entry.rootType, true, true);
}
if (entry.filesystem.name === VolumeManagerCommon.VolumeType.DRIVE) {
var volumeInfo = this.volumeInfoList.item(0);
- var isRootEntry = entry.fullPath === '/root';
- return new EntryLocationImpl(volumeInfo, VolumeManagerCommon.RootType.DRIVE,
- isRootEntry, true);
+ var roootType;
+ var isRootEntry;
+ if (entry.fullPath.startsWith('/team_drives')) {
+ if (entry.fullPath === '/team_drives') {
+ rootType = VolumeManagerCommon.RootType.TEAM_DRIVES_GRAND_ROOT;
+ isRootEntry = true;
+ } else {
+ rootType = VolumeManagerCommon.RootType.TEAM_DRIVE;
+ isRootEntry = util.isTeamDriveRoot(entry);
+ }
+ } else {
+ rootType = VolumeManagerCommon.RootType.DRIVE;
+ isRootEntry = entry.fullPath === '/root';
+ }
+ return new EntryLocationImpl(volumeInfo, rootType, isRootEntry, true);
}
throw new Error('Not implemented exception.');
};

Powered by Google App Engine
This is Rietveld 408576698