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

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

Issue 736663002: Refoctoring FileSelection and FileSelectionHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/foreground/js/file_manager_commands.js
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
index 3b1bf35ec005fdb4878c5f6583f9f1e2c3cd0d62..1d684d058b15f439d9aaa42e1c71604d8038d61a 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
@@ -107,23 +107,6 @@ CommandUtil.canExecuteAlways = function(event) {
};
/**
- * Returns a single selected/passed entry or null.
- * @param {!Event} event Command event.
- * @param {!FileManager} fileManager FileManager to use.
- * @return {FileEntry} The entry or null.
- */
-CommandUtil.getSingleEntry = function(event, fileManager) {
- if (event.target.entry) {
- return event.target.entry;
- }
- var selection = fileManager.getSelection();
- if (selection.totalCount == 1) {
- return selection.entries[0];
- }
- return null;
-};
-
-/**
* Obtains target entries that can be pinned from the selection.
* If directories are included in the selection, it just returns an empty
* array to avoid confusing because pinning directory is not supported
@@ -236,7 +219,7 @@ CommandUtil.getOnlyOneSelectedDirectory = function(selection) {
return null;
if (!selection.entries[0].isDirectory)
return null;
- return selection.entries[0];
+ return /** @type {!DirectoryEntry} */(selection.entries[0]);
};
/**

Powered by Google App Engine
This is Rietveld 408576698