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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTION_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTION_H_
10 #include "base/files/file.h"
11 #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/provided_file_system_info.h"
14 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h"
15 #include "chrome/browser/chromeos/file_system_provider/request_value.h"
16 #include "chrome/common/extensions/api/file_system_provider_internal.h"
17 #include "storage/browser/fileapi/async_file_util.h"
23 namespace extensions
{
25 } // namespace extensions
28 namespace file_system_provider
{
29 namespace operations
{
31 // Bridge between chrome.fileManagerPrivate.executeEntryAction operation and
32 // the providing extension's onExecuteActionRequested event. Created per
34 class ExecuteAction
: public Operation
{
36 ExecuteAction(extensions::EventRouter
* event_router
,
37 const ProvidedFileSystemInfo
& file_system_info
,
38 const base::FilePath
& entry_path
,
39 const std::string
& action_id
,
40 const storage::AsyncFileUtil::StatusCallback
& callback
);
41 ~ExecuteAction() override
;
43 // Operation overrides.
44 bool Execute(int request_id
) override
;
45 void OnSuccess(int request_id
,
46 scoped_ptr
<RequestValue
> result
,
47 bool has_more
) override
;
48 void OnError(int request_id
,
49 scoped_ptr
<RequestValue
> result
,
50 base::File::Error error
) override
;
53 const base::FilePath entry_path_
;
54 const std::string action_id_
;
55 const storage::AsyncFileUtil::StatusCallback callback_
;
57 DISALLOW_COPY_AND_ASSIGN(ExecuteAction
);
60 } // namespace operations
61 } // namespace file_system_provider
62 } // namespace chromeos
64 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_EXECUTE_ACTION_H_