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

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

Issue 2513493002: Files App: Update the context menu when installed app is changed. (Closed)
Patch Set: Fixed test. Created 4 years 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/task_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/task_controller.js b/ui/file_manager/file_manager/foreground/js/task_controller.js
index 0ecdef30c1d447eddbd794bb6a13be75b24b3638..a703d14c00d7f9c8d5a5109887dd38fb1940e018 100644
--- a/ui/file_manager/file_manager/foreground/js/task_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/task_controller.js
@@ -97,7 +97,9 @@ function TaskController(
this.onSelectionChanged_.bind(this));
this.selectionHandler_.addEventListener(
FileSelectionHandler.EventType.CHANGE_THROTTLED,
- this.onSelectionChangeThrottled_.bind(this));
+ this.updateTasks_.bind(this));
+ chrome.fileManagerPrivate.onAppsUpdated.addListener(
+ this.updateTasks_.bind(this));
}
/**
@@ -277,10 +279,10 @@ TaskController.prototype.onSelectionChanged_ = function() {
};
/**
- * Handles change of selection asynchronously and updates context menu.
+ * Updates available tasks opened from context menu or the open button.
* @private
*/
-TaskController.prototype.onSelectionChangeThrottled_ = function() {
+TaskController.prototype.updateTasks_ = function() {
var selection = this.selectionHandler_.selection;
if (this.dialogType_ === DialogType.FULL_PAGE &&
(selection.directoryCount > 0 || selection.fileCount > 0)) {

Powered by Google App Engine
This is Rietveld 408576698