Chromium Code Reviews| 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..591911b9869c7b6361c0a3d12680d987b8c9551e 100644 |
| --- a/chrome/browser/extensions/api/file_system/file_system_api.h |
| +++ b/chrome/browser/extensions/api/file_system/file_system_api.h |
| @@ -10,10 +10,17 @@ |
| #include "base/files/file.h" |
| #include "base/files/file_path.h" |
| +#include "base/memory/ref_counted.h" |
|
hirono
2015/03/19 03:33:54
nit: Is this ref_counted used?
mtomasz
2015/03/19 10:28:41
Not at all. Done.
|
| #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 storage { |
| +class FileSystemContext; |
| +} // namespace storage |
| + |
| namespace extensions { |
| class ExtensionPrefs; |
| @@ -240,6 +247,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_ |