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

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

Issue 2930443002: Show confirmation dialog when copy/move operation affect other members. (Closed)
Patch Set: Address comments. Created 3 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/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.

Powered by Google App Engine
This is Rietveld 408576698