| Index: chrome/browser/extensions/api/file_system/file_system_api.h
|
| diff --git a/chrome/browser/extensions/api/file_system/file_system_api.h b/chrome/browser/extensions/api/file_system/file_system_api.h
|
| index a2f9e4dbd89d98031aacd2016830aadd73eb5d70..010fea509aa98db7f1d9928cfd7012046a349d6a 100644
|
| --- a/chrome/browser/extensions/api/file_system/file_system_api.h
|
| +++ b/chrome/browser/extensions/api/file_system/file_system_api.h
|
| @@ -11,7 +11,9 @@
|
| #include "base/files/file.h"
|
| #include "base/files/file_path.h"
|
| #include "chrome/browser/extensions/chrome_extension_function.h"
|
| +#include "chrome/browser/extensions/chrome_extension_function_details.h"
|
| #include "chrome/common/extensions/api/file_system.h"
|
| +#include "extensions/browser/extension_function.h"
|
| #include "ui/shell_dialogs/select_file_dialog.h"
|
|
|
| namespace extensions {
|
| @@ -240,6 +242,35 @@ class FileSystemGetObservedEntriesFunction
|
| bool RunSync() override;
|
| };
|
|
|
| +// Requests a file system for the specified volume id.
|
| +class FileSystemRequestFileSystemFunction : public UIThreadExtensionFunction {
|
| + public:
|
| + DECLARE_EXTENSION_FUNCTION("fileSystem.requestFileSystem",
|
| + FILESYSTEM_REQUESTFILESYSTEM)
|
| + FileSystemRequestFileSystemFunction();
|
| +
|
| + protected:
|
| + ~FileSystemRequestFileSystemFunction() override {}
|
| +
|
| + // AsyncExtensionFunction overrides.
|
| + ExtensionFunction::ResponseAction Run() override;
|
| +
|
| + private:
|
| + ChromeExtensionFunctionDetails chrome_details_;
|
| +
|
| +#if defined(OS_CHROMEOS)
|
| + // Requests user consent for accessing the volume identified by |name|.
|
| + void RequestConsent(const std::string& display_name,
|
| + bool writable,
|
| + const base::Callback<void(bool)>& callback);
|
| + // Called when a user grants or rejects permissions for the file system
|
| + // access.
|
| + void OnConsentReceived(const std::string& volume_id,
|
| + bool writable,
|
| + bool granted);
|
| +#endif
|
| +};
|
| +
|
| } // namespace extensions
|
|
|
| #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_
|
|
|