1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file provides task related API functions.
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
14 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
20 namespace extensions
{
22 namespace app_file_handler_util
{
23 class MimeTypeCollector
;
24 } // namespace app_file_handler_util
26 // Implements the chrome.fileManagerPrivateInternal.executeTask method.
27 class FileManagerPrivateInternalExecuteTaskFunction
28 : public LoggedAsyncExtensionFunction
{
30 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.executeTask",
31 FILEMANAGERPRIVATEINTERNAL_EXECUTETASK
)
34 ~FileManagerPrivateInternalExecuteTaskFunction() override
{}
36 // AsyncExtensionFunction overrides.
37 bool RunAsync() override
;
41 extensions::api::file_manager_private::TaskResult success
);
44 // Implements the chrome.fileManagerPrivateInternal.getFileTasks method.
45 class FileManagerPrivateInternalGetFileTasksFunction
46 : public LoggedAsyncExtensionFunction
{
48 FileManagerPrivateInternalGetFileTasksFunction();
50 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getFileTasks",
51 FILEMANAGERPRIVATEINTERNAL_GETFILETASKS
)
54 ~FileManagerPrivateInternalGetFileTasksFunction() override
;
56 // AsyncExtensionFunction overrides.
57 bool RunAsync() override
;
60 void OnMimeTypesCollected(scoped_ptr
<std::vector
<std::string
> > mime_types
);
62 void OnSniffingMimeTypeCompleted(
63 scoped_ptr
<app_file_handler_util::PathAndMimeTypeSet
> path_mime_set
,
64 scoped_ptr
<std::vector
<GURL
>> urls
);
66 scoped_ptr
<app_file_handler_util::MimeTypeCollector
> collector_
;
67 std::vector
<GURL
> urls_
;
68 std::vector
<base::FilePath
> local_paths_
;
71 // Implements the chrome.fileManagerPrivateInternal.setDefaultTask method.
72 class FileManagerPrivateInternalSetDefaultTaskFunction
73 : public ChromeSyncExtensionFunction
{
75 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.setDefaultTask",
76 FILEMANAGERPRIVATEINTERNAL_SETDEFAULTTASK
)
79 ~FileManagerPrivateInternalSetDefaultTaskFunction() override
{}
81 // SyncExtensionFunction overrides.
82 bool RunSync() override
;
85 } // namespace extensions
87 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_