OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTION_H _ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTION_H _ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTION_H _ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTION_H _ |
7 | 7 |
8 #include <vector> | |
8 #include <string> | 9 #include <string> |
Dan Beam
2015/09/17 16:52:33
swap these to please the presubmit
mtomasz
2015/09/18 01:20:33
Done.
| |
9 | 10 |
10 #include "base/files/file.h" | 11 #include "base/files/file.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" | 13 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" |
13 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" | 14 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" |
14 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" | 15 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" |
15 #include "chrome/browser/chromeos/file_system_provider/request_value.h" | 16 #include "chrome/browser/chromeos/file_system_provider/request_value.h" |
16 #include "chrome/common/extensions/api/file_system_provider_internal.h" | 17 #include "chrome/common/extensions/api/file_system_provider_internal.h" |
17 #include "storage/browser/fileapi/async_file_util.h" | 18 #include "storage/browser/fileapi/async_file_util.h" |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class FilePath; | 21 class FilePath; |
21 } // namespace base | 22 } // namespace base |
22 | 23 |
23 namespace extensions { | 24 namespace extensions { |
24 class EventRouter; | 25 class EventRouter; |
25 } // namespace extensions | 26 } // namespace extensions |
26 | 27 |
27 namespace chromeos { | 28 namespace chromeos { |
28 namespace file_system_provider { | 29 namespace file_system_provider { |
29 namespace operations { | 30 namespace operations { |
30 | 31 |
31 // Bridge between chrome.fileManagerPrivate.executeEntryAction operation and | 32 // Bridge between chrome.fileManagerPrivate.executeCustomAction operation and |
32 // the providing extension's onExecuteActionRequested event. Created per | 33 // the providing extension's onExecuteActionRequested event. Created per |
33 // request. | 34 // request. |
34 class ExecuteAction : public Operation { | 35 class ExecuteAction : public Operation { |
35 public: | 36 public: |
36 ExecuteAction(extensions::EventRouter* event_router, | 37 ExecuteAction(extensions::EventRouter* event_router, |
37 const ProvidedFileSystemInfo& file_system_info, | 38 const ProvidedFileSystemInfo& file_system_info, |
38 const base::FilePath& entry_path, | 39 const std::vector<base::FilePath>& entry_path, |
39 const std::string& action_id, | 40 const std::string& action_id, |
40 const storage::AsyncFileUtil::StatusCallback& callback); | 41 const storage::AsyncFileUtil::StatusCallback& callback); |
41 ~ExecuteAction() override; | 42 ~ExecuteAction() override; |
42 | 43 |
43 // Operation overrides. | 44 // Operation overrides. |
44 bool Execute(int request_id) override; | 45 bool Execute(int request_id) override; |
45 void OnSuccess(int request_id, | 46 void OnSuccess(int request_id, |
46 scoped_ptr<RequestValue> result, | 47 scoped_ptr<RequestValue> result, |
47 bool has_more) override; | 48 bool has_more) override; |
48 void OnError(int request_id, | 49 void OnError(int request_id, |
49 scoped_ptr<RequestValue> result, | 50 scoped_ptr<RequestValue> result, |
50 base::File::Error error) override; | 51 base::File::Error error) override; |
51 | 52 |
52 private: | 53 private: |
53 const base::FilePath entry_path_; | 54 const std::vector<base::FilePath> entry_paths_; |
54 const std::string action_id_; | 55 const std::string action_id_; |
55 const storage::AsyncFileUtil::StatusCallback callback_; | 56 const storage::AsyncFileUtil::StatusCallback callback_; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(ExecuteAction); | 58 DISALLOW_COPY_AND_ASSIGN(ExecuteAction); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace operations | 61 } // namespace operations |
61 } // namespace file_system_provider | 62 } // namespace file_system_provider |
62 } // namespace chromeos | 63 } // namespace chromeos |
63 | 64 |
64 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTIO N_H_ | 65 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTIO N_H_ |
OLD | NEW |