Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / chromeos / extensions / file_manager / private_api_tasks.h
blob25087a0806d68113f3afc48e80f72c1063cb23b7
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"
16 namespace base {
17 class FilePath;
18 } // namespace base
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 {
29 public:
30 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.executeTask",
31 FILEMANAGERPRIVATEINTERNAL_EXECUTETASK)
33 protected:
34 ~FileManagerPrivateInternalExecuteTaskFunction() override {}
36 // AsyncExtensionFunction overrides.
37 bool RunAsync() override;
39 private:
40 void OnTaskExecuted(
41 extensions::api::file_manager_private::TaskResult success);
44 // Implements the chrome.fileManagerPrivateInternal.getFileTasks method.
45 class FileManagerPrivateInternalGetFileTasksFunction
46 : public LoggedAsyncExtensionFunction {
47 public:
48 FileManagerPrivateInternalGetFileTasksFunction();
50 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getFileTasks",
51 FILEMANAGERPRIVATEINTERNAL_GETFILETASKS)
53 protected:
54 ~FileManagerPrivateInternalGetFileTasksFunction() override;
56 // AsyncExtensionFunction overrides.
57 bool RunAsync() override;
59 private:
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 {
74 public:
75 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.setDefaultTask",
76 FILEMANAGERPRIVATEINTERNAL_SETDEFAULTTASK)
78 protected:
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_