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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 // Generates task id for the task specified by |app_id|, |task_type| and | 203 // Generates task id for the task specified by |app_id|, |task_type| and |
204 // |action_id|. | 204 // |action_id|. |
205 // | 205 // |
206 // |app_id| is either of Chrome Extension/App ID or Drive App ID. | 206 // |app_id| is either of Chrome Extension/App ID or Drive App ID. |
207 // |action_id| is a free-form string ID for the action. | 207 // |action_id| is a free-form string ID for the action. |
208 std::string MakeTaskID(const std::string& app_id, | 208 std::string MakeTaskID(const std::string& app_id, |
209 TaskType task_type, | 209 TaskType task_type, |
210 const std::string& action_id); | 210 const std::string& action_id); |
211 | 211 |
212 // Returns a task id for the Drive app with |app_id|. | |
213 std::string MakeDriveAppTaskId(const std::string& app_id); | |
214 | |
215 // Converts |task_descriptor| to a task ID. | 212 // Converts |task_descriptor| to a task ID. |
216 std::string TaskDescriptorToId(const TaskDescriptor& task_descriptor); | 213 std::string TaskDescriptorToId(const TaskDescriptor& task_descriptor); |
217 | 214 |
218 // Parses the task ID and extracts app ID, task type, and action ID into | 215 // Parses the task ID and extracts app ID, task type, and action ID into |
219 // |task|. On failure, returns false, and the contents of |task| are | 216 // |task|. On failure, returns false, and the contents of |task| are |
220 // undefined. | 217 // undefined. |
221 // | 218 // |
222 // See also the comment at the beginning of the file for details for how | 219 // See also the comment at the beginning of the file for details for how |
223 // "task_id" looks like. | 220 // "task_id" looks like. |
224 bool ParseTaskID(const std::string& task_id, TaskDescriptor* task); | 221 bool ParseTaskID(const std::string& task_id, TaskDescriptor* task); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // 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 |
295 // should be set as default before calling this function. | 292 // should be set as default before calling this function. |
296 void ChooseAndSetDefaultTask(const PrefService& pref_service, | 293 void ChooseAndSetDefaultTask(const PrefService& pref_service, |
297 const PathAndMimeTypeSet& path_mime_set, | 294 const PathAndMimeTypeSet& path_mime_set, |
298 std::vector<FullTaskDescriptor>* tasks); | 295 std::vector<FullTaskDescriptor>* tasks); |
299 | 296 |
300 } // namespace file_tasks | 297 } // namespace file_tasks |
301 } // namespace file_manager | 298 } // namespace file_manager |
302 | 299 |
303 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ | 300 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ |
OLD | NEW |