| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * This object encapsulates everything related to tasks execution. | 8 * This object encapsulates everything related to tasks execution. |
| 9 * | 9 * |
| 10 * @param {FileManager} fileManager FileManager instance. | 10 * @param {FileManager} fileManager FileManager instance. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 if (FileType.isOnDrive(this.urls_[index])) { | 183 if (FileType.isOnDrive(this.urls_[index])) { |
| 184 isOnDrive = true; | 184 isOnDrive = true; |
| 185 break; | 185 break; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 for (var i = 0; i < tasks.length; i++) { | 189 for (var i = 0; i < tasks.length; i++) { |
| 190 var task = tasks[i]; | 190 var task = tasks[i]; |
| 191 var taskParts = task.taskId.split('|'); | 191 var taskParts = task.taskId.split('|'); |
| 192 | 192 |
| 193 // Skip Drive App if the file is not on Drive. | |
| 194 if (!isOnDrive && task.driveApp) | |
| 195 continue; | |
| 196 | |
| 197 // Skip internal Files.app's handlers. | 193 // Skip internal Files.app's handlers. |
| 198 if (taskParts[0] == id && (taskParts[2] == 'auto-open' || | 194 if (taskParts[0] == id && (taskParts[2] == 'auto-open' || |
| 199 taskParts[2] == 'select' || taskParts[2] == 'open')) { | 195 taskParts[2] == 'select' || taskParts[2] == 'open')) { |
| 200 continue; | 196 continue; |
| 201 } | 197 } |
| 202 | 198 |
| 203 // Tweak images, titles of internal tasks. | 199 // Tweak images, titles of internal tasks. |
| 204 if (taskParts[0] == id && taskParts[1] == 'file') { | 200 if (taskParts[0] == id && taskParts[1] == 'file') { |
| 205 if (taskParts[2] == 'play') { | 201 if (taskParts[2] == 'play') { |
| 206 // TODO(serya): This hack needed until task.iconUrl is working | 202 // TODO(serya): This hack needed until task.iconUrl is working |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 items, defaultIdx, | 730 items, defaultIdx, |
| 735 function(item) { | 731 function(item) { |
| 736 onSuccess(item.task); | 732 onSuccess(item.task); |
| 737 }); | 733 }); |
| 738 }; | 734 }; |
| 739 | 735 |
| 740 FileTasks.decorate('display'); | 736 FileTasks.decorate('display'); |
| 741 FileTasks.decorate('updateMenuItem'); | 737 FileTasks.decorate('updateMenuItem'); |
| 742 FileTasks.decorate('execute'); | 738 FileTasks.decorate('execute'); |
| 743 FileTasks.decorate('executeDefault'); | 739 FileTasks.decorate('executeDefault'); |
| OLD | NEW |