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

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

Issue 1215533003: Add a refresh button for providers which do not support watchers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/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 61adeaa1ad02725114dee285cd4984728a2be67c..bfb6c2ef712b7214ae47d2ae2d69dbb520e90769 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
@@ -1424,3 +1424,22 @@ CommandHandler.COMMANDS_['configure'] = (function() {
return new ConfigureCommand();
})();
+/**
+ * Refreshes the currently selected directory.
+ */
+CommandHandler.COMMANDS_['refresh'] = /** @type {Command} */ ({
+ /**
+ * @param {!Event} event Command event.
+ * @param {!FileManager} fileManager FileManager to use.
+ */
+ execute: function(event, fileManager) {
+ // TODO(mtomasz): Implement refreshing.
+ },
+ canExecute: function(event, fileManager) {
+ var currentDirEntry = fileManager.directoryModel.getCurrentDirEntry();
+ var volumeInfo = fileManager.volumeManager.getVolumeInfo(currentDirEntry);
+ event.canExecute = !volumeInfo.watchable;
fukino 2015/07/01 10:39:33 Could you add null check as volumeInfo can be null
mtomasz 2015/07/02 08:52:40 Done.
+ event.command.setHidden(!event.canExecute ||
+ fileManager.directoryModel.getFileListSelection().getCheckSelectMode());
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698