OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 task related API functions. | 5 // This file provides task related API functions. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ |
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ | 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ |
9 | 9 |
| 10 #include <memory> |
10 #include <set> | 11 #include <set> |
11 #include <string> | 12 #include <string> |
12 #include <vector> | 13 #include <vector> |
13 | 14 |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" | 15 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" |
16 #include "chrome/browser/chromeos/file_manager/file_tasks.h" | 16 #include "chrome/browser/chromeos/file_manager/file_tasks.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class FilePath; | 19 class FilePath; |
20 } // namespace base | 20 } // namespace base |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 namespace app_file_handler_util { | 24 namespace app_file_handler_util { |
(...skipping 28 matching lines...) Expand all Loading... |
53 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getFileTasks", | 53 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getFileTasks", |
54 FILEMANAGERPRIVATEINTERNAL_GETFILETASKS) | 54 FILEMANAGERPRIVATEINTERNAL_GETFILETASKS) |
55 | 55 |
56 protected: | 56 protected: |
57 ~FileManagerPrivateInternalGetFileTasksFunction() override; | 57 ~FileManagerPrivateInternalGetFileTasksFunction() override; |
58 | 58 |
59 // AsyncExtensionFunction overrides. | 59 // AsyncExtensionFunction overrides. |
60 bool RunAsync() override; | 60 bool RunAsync() override; |
61 | 61 |
62 private: | 62 private: |
63 void OnMimeTypesCollected(scoped_ptr<std::vector<std::string> > mime_types); | 63 void OnMimeTypesCollected( |
| 64 std::unique_ptr<std::vector<std::string>> mime_types); |
64 | 65 |
65 void OnAreDirectoriesAndMimeTypesCollected( | 66 void OnAreDirectoriesAndMimeTypesCollected( |
66 scoped_ptr<std::vector<std::string>> mime_types, | 67 std::unique_ptr<std::vector<std::string>> mime_types, |
67 scoped_ptr<std::set<base::FilePath>> path_directory_set); | 68 std::unique_ptr<std::set<base::FilePath>> path_directory_set); |
68 | 69 |
69 scoped_ptr<app_file_handler_util::IsDirectoryCollector> | 70 std::unique_ptr<app_file_handler_util::IsDirectoryCollector> |
70 is_directory_collector_; | 71 is_directory_collector_; |
71 scoped_ptr<app_file_handler_util::MimeTypeCollector> mime_type_collector_; | 72 std::unique_ptr<app_file_handler_util::MimeTypeCollector> |
| 73 mime_type_collector_; |
72 std::vector<GURL> urls_; | 74 std::vector<GURL> urls_; |
73 std::vector<base::FilePath> local_paths_; | 75 std::vector<base::FilePath> local_paths_; |
74 }; | 76 }; |
75 | 77 |
76 // Implements the chrome.fileManagerPrivateInternal.setDefaultTask method. | 78 // Implements the chrome.fileManagerPrivateInternal.setDefaultTask method. |
77 class FileManagerPrivateInternalSetDefaultTaskFunction | 79 class FileManagerPrivateInternalSetDefaultTaskFunction |
78 : public ChromeSyncExtensionFunction { | 80 : public ChromeSyncExtensionFunction { |
79 public: | 81 public: |
80 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.setDefaultTask", | 82 DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.setDefaultTask", |
81 FILEMANAGERPRIVATEINTERNAL_SETDEFAULTTASK) | 83 FILEMANAGERPRIVATEINTERNAL_SETDEFAULTTASK) |
82 | 84 |
83 protected: | 85 protected: |
84 ~FileManagerPrivateInternalSetDefaultTaskFunction() override {} | 86 ~FileManagerPrivateInternalSetDefaultTaskFunction() override {} |
85 | 87 |
86 // SyncExtensionFunction overrides. | 88 // SyncExtensionFunction overrides. |
87 bool RunSync() override; | 89 bool RunSync() override; |
88 }; | 90 }; |
89 | 91 |
90 } // namespace extensions | 92 } // namespace extensions |
91 | 93 |
92 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ | 94 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ |
OLD | NEW |