| Index: chrome/browser/chromeos/extensions/file_handler_util.h
|
| diff --git a/chrome/browser/chromeos/extensions/file_handler_util.h b/chrome/browser/chromeos/extensions/file_handler_util.h
|
| index 0df041265271b30bdab51b7a2fb602f6a3303907..83337bf2afc0918189e948e9a8a0cf966d1c4f14 100644
|
| --- a/chrome/browser/chromeos/extensions/file_handler_util.h
|
| +++ b/chrome/browser/chromeos/extensions/file_handler_util.h
|
| @@ -19,6 +19,16 @@ class Profile;
|
|
|
| namespace file_handler_util {
|
|
|
| +// Specifies the task type for a task id that represents some file action, Drive
|
| +// action, or Web Intent action.
|
| +enum TaskType {
|
| + TASK_FILE = 1,
|
| + TASK_DRIVE,
|
| + TASK_WEBINTENT
|
| +};
|
| +
|
| +void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id);
|
| +
|
| // Update the default file handler for the given sets of suffixes and MIME
|
| // types.
|
| void UpdateDefaultTask(Profile* profile,
|
| @@ -39,27 +49,17 @@ int GetReadWritePermissions();
|
| // Gets read-only file access permission flags.
|
| int GetReadOnlyPermissions();
|
|
|
| -// Generates file task id for the file action specified by the extension.
|
| +// Generates task id for the action specified by the extension.
|
| std::string MakeTaskID(const std::string& extension_id,
|
| + TaskType task_type,
|
| const std::string& action_id);
|
|
|
| -// Make a task id specific to drive apps instead of extensions.
|
| -std::string MakeDriveTaskID(const std::string& app_id,
|
| - const std::string& action_id);
|
| -
|
| -// Returns the |target_id| and |action_id| of a drive app or extension, given
|
| -// the drive |task_id| created by MakeDriveTaskID. If the |task_id| is a drive
|
| -// task_id then it will return true. If not, or if parsing fails, will return
|
| -// false and not set |app_id| or |action_id|.
|
| -bool CrackDriveTaskID(const std::string& task_id,
|
| - std::string* app_id,
|
| - std::string* action_id);
|
| -
|
| -// Extracts action and extension id bound to the file task. Either
|
| +// Extracts action, type and extension id bound to the file task. Either
|
| // |target_extension_id| or |action_id| are allowed to be NULL if caller isn't
|
| // interested in those values. Returns false on failure to parse.
|
| bool CrackTaskID(const std::string& task_id,
|
| std::string* target_extension_id,
|
| + TaskType* task_type,
|
| std::string* action_id);
|
|
|
| // This generates a list of default tasks (tasks set as default by the user in
|
| @@ -86,13 +86,11 @@ typedef base::Callback<void(bool)> FileTaskFinishedCallback;
|
| // Helper class for executing file browser file action.
|
| class FileTaskExecutor : public base::RefCountedThreadSafe<FileTaskExecutor> {
|
| public:
|
| - static const char kDriveTaskExtensionPrefix[];
|
| - static const size_t kDriveTaskExtensionPrefixLength;
|
| -
|
| // Creates the appropriate FileTaskExecutor for the given |extension_id|.
|
| static FileTaskExecutor* Create(Profile* profile,
|
| const GURL source_url,
|
| const std::string& extension_id,
|
| + TaskType task_type,
|
| const std::string& action_id);
|
|
|
| // Same as ExecuteAndNotify, but no notification is performed.
|
|
|