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

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_model.js

Issue 1138973002: Disable zip selection on MTP volume. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/directory_model.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js
index 4dd71e8dcacef6e640c32dcbc05fa3bdd406270a..5a658a5215a743ae934a3ac2f110ac5077c4fd5e 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -179,13 +179,29 @@ DirectoryModel.prototype.isSearching = function() {
};
/**
- * @return {boolean}
+ * @return {boolean} True if it's on Drive.
*/
DirectoryModel.prototype.isOnDrive = function() {
+ return this.isCurrentRootVolumeType_(VolumeManagerCommon.VolumeType.DRIVE);
+};
+
+/**
+ * @return {boolean} True if it's on MTP volume.
+ */
+DirectoryModel.prototype.isOnMTP = function() {
+ return this.isCurrentRootVolumeType_(VolumeManagerCommon.VolumeType.MTP);
+};
+
+/**
+ * @param {VolumeManagerCommon.VolumeType} volumeType Volume Type
+ * @return {boolean} True if current root volume type is equal to specified
+ * volume type.
+ * @private
+ */
+DirectoryModel.prototype.isCurrentRootVolumeType_ = function(volumeType) {
var rootType = this.getCurrentRootType();
return rootType != null &&
- VolumeManagerCommon.getVolumeTypeFromRootType(rootType) ==
- VolumeManagerCommon.VolumeType.DRIVE;
+ VolumeManagerCommon.getVolumeTypeFromRootType(rootType) === volumeType;
};
/**
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698