ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / chromeos / extensions / file_manager / private_api_tasks.h
blobc895354b7b04371b65fbf9d92490d2780ef571b1
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.
4 //
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_
10 #include <vector>
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"
15 #include "chrome/common/extensions/api/file_manager_private.h"
17 namespace base {
18 class FilePath;
19 } // namespace base
21 namespace extensions {
23 namespace app_file_handler_util {
24 class MimeTypeCollector;
25 } // namespace app_file_handler_util
27 // Implements the chrome.fileManagerPrivate.executeTask method.
28 class FileManagerPrivateExecuteTaskFunction
29 : public LoggedAsyncExtensionFunction {
30 public:
31 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.executeTask",
32 FILEMANAGERPRIVATE_EXECUTETASK)
34 protected:
35 ~FileManagerPrivateExecuteTaskFunction() override {}
37 // AsyncExtensionFunction overrides.
38 bool RunAsync() override;
40 private:
41 void OnTaskExecuted(
42 extensions::api::file_manager_private::TaskResult success);
45 // Implements the chrome.fileManagerPrivate.getFileTasks method.
46 class FileManagerPrivateGetFileTasksFunction
47 : public LoggedAsyncExtensionFunction {
48 public:
49 FileManagerPrivateGetFileTasksFunction();
51 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getFileTasks",
52 FILEMANAGERPRIVATE_GETFILETASKS)
54 protected:
55 ~FileManagerPrivateGetFileTasksFunction() override;
57 // AsyncExtensionFunction overrides.
58 bool RunAsync() override;
60 private:
61 void OnMimeTypesCollected(scoped_ptr<std::vector<std::string> > mime_types);
63 void OnSniffingMimeTypeCompleted(
64 scoped_ptr<app_file_handler_util::PathAndMimeTypeSet> path_mime_set,
65 scoped_ptr<std::vector<GURL> > file_urls);
67 scoped_ptr<app_file_handler_util::MimeTypeCollector> collector_;
68 std::vector<GURL> file_urls_;
69 std::vector<base::FilePath> local_paths_;
72 // Implements the chrome.fileManagerPrivate.setDefaultTask method.
73 class FileManagerPrivateSetDefaultTaskFunction
74 : public ChromeSyncExtensionFunction {
75 public:
76 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.setDefaultTask",
77 FILEMANAGERPRIVATE_SETDEFAULTTASK)
79 protected:
80 ~FileManagerPrivateSetDefaultTaskFunction() override {}
82 // SyncExtensionFunction overrides.
83 bool RunSync() override;
86 } // namespace extensions
88 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_