| 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 representation of actions that can be performed over the | 9 // File tasks are representation 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 #include "chrome/common/extensions/api/file_browser_private.h" | 120 #include "chrome/common/extensions/api/file_browser_private.h" |
| 121 #include "url/gurl.h" | 121 #include "url/gurl.h" |
| 122 | 122 |
| 123 class PrefService; | 123 class PrefService; |
| 124 class Profile; | 124 class Profile; |
| 125 | 125 |
| 126 namespace drive { | 126 namespace drive { |
| 127 class DriveAppRegistry; | 127 class DriveAppRegistry; |
| 128 } | 128 } |
| 129 | 129 |
| 130 namespace fileapi { | 130 namespace storage { |
| 131 class FileSystemURL; | 131 class FileSystemURL; |
| 132 } | 132 } |
| 133 | 133 |
| 134 namespace file_manager { | 134 namespace file_manager { |
| 135 namespace file_tasks { | 135 namespace file_tasks { |
| 136 | 136 |
| 137 // Task types as explained in the comment above. Search for <task-type>. | 137 // Task types as explained in the comment above. Search for <task-type>. |
| 138 enum TaskType { | 138 enum TaskType { |
| 139 TASK_TYPE_FILE_BROWSER_HANDLER, | 139 TASK_TYPE_FILE_BROWSER_HANDLER, |
| 140 TASK_TYPE_FILE_HANDLER, | 140 TASK_TYPE_FILE_HANDLER, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // profile - The profile used for making this function call. | 234 // profile - The profile used for making this function call. |
| 235 // source_url - The source URL which originates this function call. | 235 // source_url - The source URL which originates this function call. |
| 236 // task - See the comment at TaskDescriptor struct. | 236 // task - See the comment at TaskDescriptor struct. |
| 237 // file_urls - URLs of the target files. | 237 // file_urls - URLs of the target files. |
| 238 // done - The callback which will be called on completion. | 238 // done - The callback which will be called on completion. |
| 239 // The callback won't be called if the function returns | 239 // The callback won't be called if the function returns |
| 240 // false. | 240 // false. |
| 241 bool ExecuteFileTask(Profile* profile, | 241 bool ExecuteFileTask(Profile* profile, |
| 242 const GURL& source_url, | 242 const GURL& source_url, |
| 243 const TaskDescriptor& task, | 243 const TaskDescriptor& task, |
| 244 const std::vector<fileapi::FileSystemURL>& file_urls, | 244 const std::vector<storage::FileSystemURL>& file_urls, |
| 245 const FileTaskFinishedCallback& done); | 245 const FileTaskFinishedCallback& done); |
| 246 | 246 |
| 247 typedef extensions::app_file_handler_util::PathAndMimeTypeSet | 247 typedef extensions::app_file_handler_util::PathAndMimeTypeSet |
| 248 PathAndMimeTypeSet; | 248 PathAndMimeTypeSet; |
| 249 | 249 |
| 250 // Finds the Drive app tasks that can be used with the given |path_mime_set| | 250 // Finds the Drive app tasks that can be used with the given |path_mime_set| |
| 251 // from |drive_app_registry|, and append them to the |result_list|. | 251 // from |drive_app_registry|, and append them to the |result_list|. |
| 252 // Drive app tasks will be found only if all of the files are on Drive. | 252 // Drive app tasks will be found only if all of the files are on Drive. |
| 253 void FindDriveAppTasks(const drive::DriveAppRegistry& drive_app_registry, | 253 void FindDriveAppTasks(const drive::DriveAppRegistry& drive_app_registry, |
| 254 const PathAndMimeTypeSet& path_mime_set, | 254 const PathAndMimeTypeSet& path_mime_set, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // task is found (i.e. the default task may not exist in |tasks|). No tasks | 291 // task is found (i.e. the default task may not exist in |tasks|). No tasks |
| 292 // should be set as default before calling this function. | 292 // should be set as default before calling this function. |
| 293 void ChooseAndSetDefaultTask(const PrefService& pref_service, | 293 void ChooseAndSetDefaultTask(const PrefService& pref_service, |
| 294 const PathAndMimeTypeSet& path_mime_set, | 294 const PathAndMimeTypeSet& path_mime_set, |
| 295 std::vector<FullTaskDescriptor>* tasks); | 295 std::vector<FullTaskDescriptor>* tasks); |
| 296 | 296 |
| 297 } // namespace file_tasks | 297 } // namespace file_tasks |
| 298 } // namespace file_manager | 298 } // namespace file_manager |
| 299 | 299 |
| 300 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ | 300 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ |
| OLD | NEW |