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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager_commands.js

Issue 23944007: [Files.app] Remove CommandUtil.getCommandPath() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager_commands.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager_commands.js b/chrome/browser/resources/file_manager/js/file_manager_commands.js
index 23170fcc39b0fac20367c77586a75a99c52bdb18..b0b268f094cfb15463f64a41ffffbc5d7473ea3f 100644
--- a/chrome/browser/resources/file_manager/js/file_manager_commands.js
+++ b/chrome/browser/resources/file_manager/js/file_manager_commands.js
@@ -48,35 +48,6 @@ CommandUtil.getCommandEntry = function(element) {
};
/**
- * Extracts path on which command event was dispatched.
- * TODO(yoshiki): Remove this method after adding automatically removing an
- * inactive shortcut on M31.
- *
- * @param {NavigationList|NavigationListItem} element Directory to extract a
- * path from.
- * @return {string} Path of the found node.
- */
-CommandUtil.getCommandPath = function(element) {
- if (element instanceof NavigationList) {
- // element is a NavigationList.
-
- /** @type {NavigationModelItem} */
- var selectedItem = element.selectedItem;
- return selectedItem && selectedItem.path;
- } else if (element instanceof NavigationListItem) {
- // element is a subitem of NavigationList.
- /** @type {NavigationList} */
- var navigationList = element.parentElement;
- var index = navigationList.getIndexOfListItem(element);
- /** @type {NavigationModelItem} */
- var item = (index != -1) ? navigationList.dataModel.item(index) : null;
- return item && item.path;
- }
-
- console.error('Unsupported element.');
-};
-
-/**
* @param {NavigationList} navigationList navigation list to extract root node.
* @return {?RootType} Type of the found root.
*/
@@ -646,10 +617,8 @@ Commands.removeFolderShortcutCommand = {
*/
execute: function(event, fileManager) {
var entry = CommandUtil.getCommandEntry(event.target);
- var path =
- entry ? entry.fullPath : CommandUtil.getCommandPath(event.target);
- if (path)
- fileManager.removeFolderShortcut(path);
+ if (entry && entry.fullPath)
+ fileManager.removeFolderShortcut(entry.fullPath);
},
/**
@@ -665,8 +634,7 @@ Commands.removeFolderShortcutCommand = {
}
var entry = CommandUtil.getCommandEntry(target);
- var path =
- entry ? entry.fullPath : CommandUtil.getCommandPath(event.target);
+ var path = entry && entry.fullPath;
var eligible = path && PathUtil.isEligibleForFolderShortcut(path);
var isShortcut = path && fileManager.folderShortcutExists(path);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698