| 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 // This file provides utility functions for "file tasks". | 5 // This file provides utility functions for "file tasks". |
| 6 // | 6 // |
| 7 // WHAT ARE FILE TASKS? | 7 // WHAT ARE FILE TASKS? |
| 8 // | 8 // |
| 9 // File tasks are representatiosn of actions that can be performed over the | 9 // File tasks are representatiosn of actions that can be performed over the |
| 10 // currently selected files from Files.app. A task can be either of: | 10 // currently selected files from Files.app. A task can be either of: |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 230 |
| 231 // Executes file handler task for each element of |file_urls|. | 231 // Executes file handler task for each element of |file_urls|. |
| 232 // Returns |false| if the execution cannot be initiated. Otherwise returns | 232 // Returns |false| if the execution cannot be initiated. Otherwise returns |
| 233 // |true| and then eventually calls |done| when all the files have been handled. | 233 // |true| and then eventually calls |done| when all the files have been handled. |
| 234 // |done| can be a null callback. | 234 // |done| can be a null callback. |
| 235 // | 235 // |
| 236 // Parameters: | 236 // Parameters: |
| 237 // profile - The profile used for making this function call. | 237 // profile - The profile used for making this function call. |
| 238 // app_id - The ID of the app requesting the file task execution. | 238 // app_id - The ID of the app requesting the file task execution. |
| 239 // source_url - The source URL which originates this function call. | 239 // source_url - The source URL which originates this function call. |
| 240 // tab_id - The ID of the tab which originates this function call. | |
| 241 // This can be 0 if no tab is associated. | |
| 242 // task - See the comment at TaskDescriptor struct. | 240 // task - See the comment at TaskDescriptor struct. |
| 243 // file_urls - URLs of the target files. | 241 // file_urls - URLs of the target files. |
| 244 // done - The callback which will be called on completion. | 242 // done - The callback which will be called on completion. |
| 245 // The callback won't be called if the function returns | 243 // The callback won't be called if the function returns |
| 246 // false. | 244 // false. |
| 247 bool ExecuteFileTask(Profile* profile, | 245 bool ExecuteFileTask(Profile* profile, |
| 248 const GURL& source_url, | 246 const GURL& source_url, |
| 249 const std::string& app_id, | 247 const std::string& app_id, |
| 250 int32 tab_id, | |
| 251 const TaskDescriptor& task, | 248 const TaskDescriptor& task, |
| 252 const std::vector<fileapi::FileSystemURL>& file_urls, | 249 const std::vector<fileapi::FileSystemURL>& file_urls, |
| 253 const FileTaskFinishedCallback& done); | 250 const FileTaskFinishedCallback& done); |
| 254 | 251 |
| 255 typedef extensions::app_file_handler_util::PathAndMimeTypeSet | 252 typedef extensions::app_file_handler_util::PathAndMimeTypeSet |
| 256 PathAndMimeTypeSet; | 253 PathAndMimeTypeSet; |
| 257 | 254 |
| 258 // Finds the Drive app tasks that can be used with the given |path_mime_set| | 255 // Finds the Drive app tasks that can be used with the given |path_mime_set| |
| 259 // from |drive_app_registry|, and append them to the |result_list|. | 256 // from |drive_app_registry|, and append them to the |result_list|. |
| 260 // Drive app tasks will be found only if all of the files are on Drive. | 257 // Drive app tasks will be found only if all of the files are on Drive. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // task is found (i.e. the default task may not exist in |tasks|). No tasks | 296 // task is found (i.e. the default task may not exist in |tasks|). No tasks |
| 300 // should be set as default before calling this function. | 297 // should be set as default before calling this function. |
| 301 void ChooseAndSetDefaultTask(const PrefService& pref_service, | 298 void ChooseAndSetDefaultTask(const PrefService& pref_service, |
| 302 const PathAndMimeTypeSet& path_mime_set, | 299 const PathAndMimeTypeSet& path_mime_set, |
| 303 std::vector<FullTaskDescriptor>* tasks); | 300 std::vector<FullTaskDescriptor>* tasks); |
| 304 | 301 |
| 305 } // namespace file_tasks | 302 } // namespace file_tasks |
| 306 } // namespace file_manager | 303 } // namespace file_manager |
| 307 | 304 |
| 308 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ | 305 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ |
| OLD | NEW |