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.
5 // This file provides API functions for the file manager to act as the file
6 // dialog for opening and saving files.
8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_
9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_
13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
16 struct SelectedFileInfo
;
19 namespace extensions
{
21 // Cancel file selection Dialog. Closes the dialog window.
22 class FileManagerPrivateCancelDialogFunction
23 : public LoggedAsyncExtensionFunction
{
25 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.cancelDialog",
26 FILEMANAGERPRIVATE_CANCELDIALOG
)
29 ~FileManagerPrivateCancelDialogFunction() override
{}
31 // AsyncExtensionFunction overrides.
32 bool RunAsync() override
;
35 class FileManagerPrivateSelectFileFunction
36 : public LoggedAsyncExtensionFunction
{
38 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.selectFile",
39 FILEMANAGERPRIVATE_SELECTFILE
)
42 ~FileManagerPrivateSelectFileFunction() override
{}
44 // AsyncExtensionFunction overrides.
45 bool RunAsync() override
;
48 // A callback method to handle the result of GetSelectedFileInfo.
49 void GetSelectedFileInfoResponse(
51 const std::vector
<ui::SelectedFileInfo
>& files
);
54 // Select multiple files. Closes the dialog window.
55 class FileManagerPrivateSelectFilesFunction
56 : public LoggedAsyncExtensionFunction
{
58 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.selectFiles",
59 FILEMANAGERPRIVATE_SELECTFILES
)
62 ~FileManagerPrivateSelectFilesFunction() override
{}
64 // AsyncExtensionFunction overrides.
65 bool RunAsync() override
;
68 // A callback method to handle the result of GetSelectedFileInfo.
69 void GetSelectedFileInfoResponse(
70 const std::vector
<ui::SelectedFileInfo
>& files
);
73 } // namespace extensions
75 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DIALOG_H_