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

Unified Diff: ui/file_manager/file_manager/background/js/volume_manager_impl.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/volume_manager_impl.js
diff --git a/ui/file_manager/file_manager/background/js/volume_manager_impl.js b/ui/file_manager/file_manager/background/js/volume_manager_impl.js
index ff50e8a2edc9244eafc894b04640600797b353b6..b05ef6291e1861e65d5a8a1afff9d39f26791f28 100644
--- a/ui/file_manager/file_manager/background/js/volume_manager_impl.js
+++ b/ui/file_manager/file_manager/background/js/volume_manager_impl.js
@@ -296,8 +296,7 @@ VolumeManagerImpl.prototype.getLocationInfo = function(entry) {
if (util.isFakeEntry(entry)) {
return new EntryLocationImpl(
- volumeInfo,
- entry.rootType,
+ volumeInfo, entry.rootType,
true /* the entry points a root directory. */,
true /* fake entries are read only. */);
}
@@ -306,12 +305,31 @@ VolumeManagerImpl.prototype.getLocationInfo = function(entry) {
var isReadOnly;
var isRootEntry;
if (volumeInfo.volumeType === VolumeManagerCommon.VolumeType.DRIVE) {
- // For Drive, the roots are /root and /other, instead of /. Root URLs
- // contain trailing slashes.
+ // For Drive, the roots are /root, /team_drives and /other, instead of /.
+ // Root URLs contain trailing slashes.
if (entry.fullPath == '/root' || entry.fullPath.indexOf('/root/') === 0) {
rootType = VolumeManagerCommon.RootType.DRIVE;
isReadOnly = volumeInfo.isReadOnly;
isRootEntry = entry.fullPath === '/root';
+ } else if (
+ entry.fullPath == VolumeManagerCommon.TEAM_DRIVES_DIRECTORY_PATH ||
+ entry.fullPath.indexOf(
+ VolumeManagerCommon.TEAM_DRIVES_DIRECTORY_PATH + '/') === 0) {
+ if (entry.fullPath == VolumeManagerCommon.TEAM_DRIVES_DIRECTORY_PATH) {
+ rootType = VolumeManagerCommon.RootType.TEAM_DRIVES_GRAND_ROOT;
+ isReadOnly = true;
+ isRootEntry = true;
+ } else {
+ rootType = VolumeManagerCommon.RootType.TEAM_DRIVE;
+ if (util.isTeamDriveRoot(entry)) {
+ isReadOnly = false;
+ isRootEntry = true;
+ } else {
+ // Regular files/directories under Team Drives.
+ isRootEntry = false;
+ isReadOnly = volumeInfo.isReadOnly;
+ }
+ }
} else if (entry.fullPath == '/other' ||
entry.fullPath.indexOf('/other/') === 0) {
rootType = VolumeManagerCommon.RootType.DRIVE_OTHER;

Powered by Google App Engine
This is Rietveld 408576698