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

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

Issue 10832185: FileBrowser: Hide DriveApps on Open-with menu when the selected file is not on drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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: chrome/browser/resources/file_manager/js/file_tasks.js
diff --git a/chrome/browser/resources/file_manager/js/file_tasks.js b/chrome/browser/resources/file_manager/js/file_tasks.js
index e337265aea6ae12eb7876f591db2ca243561bd2e..ab8cda9b803353a082d8a22ad73064a6dbbacf87 100644
--- a/chrome/browser/resources/file_manager/js/file_tasks.js
+++ b/chrome/browser/resources/file_manager/js/file_tasks.js
@@ -56,10 +56,21 @@ FileTasks.prototype.onTasks_ = function(tasks) {
FileTasks.prototype.processTasks_ = function(tasks) {
this.tasks_ = [];
var id = this.fileManager_.getExtensionId();
+ var is_on_drive = false;
+ for (var index = 0; index < this.urls_.length; ++index) {
+ if (FileType.isOnGDrive(this.urls_[index])) {
+ is_on_drive = true;
+ break;
+ }
+ }
for (var i = 0; i < tasks.length; i++) {
var task = tasks[i];
+ // Skip Drive App if the file is on Drive.
+ if (!is_on_drive && task.driveApp)
+ continue;
+
// Tweak images, titles of internal tasks.
var task_parts = task.taskId.split('|');
if (task_parts[0] == id) {
« no previous file with comments | « chrome/browser/chromeos/extensions/file_browser_private_api.cc ('k') | chrome/common/extensions/api/file_browser_private.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698