| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 204 /** | 204 /** | 
| 205  * Processes internal tasks. | 205  * Processes internal tasks. | 
| 206  * | 206  * | 
| 207  * @param {Array.<Object>} tasks The tasks. | 207  * @param {Array.<Object>} tasks The tasks. | 
| 208  * @private | 208  * @private | 
| 209  */ | 209  */ | 
| 210 FileTasks.prototype.processTasks_ = function(tasks) { | 210 FileTasks.prototype.processTasks_ = function(tasks) { | 
| 211   this.tasks_ = []; | 211   this.tasks_ = []; | 
| 212   var id = chrome.runtime.id; | 212   var id = chrome.runtime.id; | 
| 213   var isOnDrive = false; | 213   var isOnDrive = false; | 
|  | 214   var fm = this.fileManager_; | 
| 214   for (var index = 0; index < this.entries_.length; ++index) { | 215   for (var index = 0; index < this.entries_.length; ++index) { | 
| 215     // TODO(mtomasz): Use Entry instead of paths. | 216     var locationInfo = fm.volumeManager.getLocationInfo(this.entries_[index]); | 
| 216     if (PathUtil.isDriveBasedPath(this.entries_[index].fullPath)) { | 217     if (locationInfo && locationInfo.isDriveBased) { | 
| 217       isOnDrive = true; | 218       isOnDrive = true; | 
| 218       break; | 219       break; | 
| 219     } | 220     } | 
| 220   } | 221   } | 
| 221 | 222 | 
| 222   for (var i = 0; i < tasks.length; i++) { | 223   for (var i = 0; i < tasks.length; i++) { | 
| 223     var task = tasks[i]; | 224     var task = tasks[i]; | 
| 224     var taskParts = task.taskId.split('|'); | 225     var taskParts = task.taskId.split('|'); | 
| 225 | 226 | 
| 226     // Skip internal Files.app's handlers. | 227     // Skip internal Files.app's handlers. | 
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 857       items, defaultIdx, | 858       items, defaultIdx, | 
| 858       function(item) { | 859       function(item) { | 
| 859         onSuccess(item.task); | 860         onSuccess(item.task); | 
| 860       }); | 861       }); | 
| 861 }; | 862 }; | 
| 862 | 863 | 
| 863 FileTasks.decorate('display'); | 864 FileTasks.decorate('display'); | 
| 864 FileTasks.decorate('updateMenuItem'); | 865 FileTasks.decorate('updateMenuItem'); | 
| 865 FileTasks.decorate('execute'); | 866 FileTasks.decorate('execute'); | 
| 866 FileTasks.decorate('executeDefault'); | 867 FileTasks.decorate('executeDefault'); | 
| OLD | NEW | 
|---|