Index: chrome/browser/resources/file_manager/js/path_util.js |
diff --git a/chrome/browser/resources/file_manager/js/path_util.js b/chrome/browser/resources/file_manager/js/path_util.js |
index fb31fb10038f1ae5559d1b6690d078a4cc03a0c8..98bd228e23b642e2c69eacb496783da3ec4ffd64 100644 |
--- a/chrome/browser/resources/file_manager/js/path_util.js |
+++ b/chrome/browser/resources/file_manager/js/path_util.js |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -131,6 +131,18 @@ PathUtil.isRootPath = function(path) { |
}; |
/** |
+ * @param {string} path A root path. |
+ * @return {boolean} True if the given path is root and user can unmount it. |
+ */ |
+PathUtil.isUnmountableByUser = function(path) { |
+ if (!PathUtil.isRootPath(path)) |
+ return false; |
+ |
+ var type = PathUtil.getRootType(path); |
+ return (type == RootType.ARCHIVE || type == RootType.REMOVABLE); |
+}; |
+ |
+/** |
* @param {string} parent_path The parent path. |
* @param {string} child_path The child path. |
* @return {boolean} True if |parent_path| is parent file path of |child_path|. |