| Index: ui/file_manager/file_manager/common/js/util.js
|
| diff --git a/ui/file_manager/file_manager/common/js/util.js b/ui/file_manager/file_manager/common/js/util.js
|
| index f322d58c12fe5da818092cd0e2a56aa2cdc5a7f2..a9501b06bd7cfe730941385016b8c1bc6b87a95e 100644
|
| --- a/ui/file_manager/file_manager/common/js/util.js
|
| +++ b/ui/file_manager/file_manager/common/js/util.js
|
| @@ -669,6 +669,21 @@ util.isTeamDriveEntry = function(entry) {
|
| tree[1] == VolumeManagerCommon.TEAM_DRIVES_DIRECTORY_NAME;
|
| };
|
|
|
| +/**
|
| + * Extracts Team Drive name from entry path.
|
| + * @param {(!Entry|!FakeEntry)} entry Entry or a fake entry.
|
| + * @return {string} The name of Team Drive. Empty string if |entry| is not
|
| + * under Team Drives.
|
| + */
|
| +util.getTeamDriveName = function(entry) {
|
| + if (!entry.fullPath || !util.isTeamDriveEntry(entry))
|
| + return '';
|
| + var tree = entry.fullPath.split('/');
|
| + if (tree.length < 3)
|
| + return '';
|
| + return tree[2];
|
| +};
|
| +
|
| /**
|
| * Creates an instance of UserDOMError with given error name that looks like a
|
| * FileError except that it does not have the deprecated FileError.code member.
|
|
|