Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.h

Issue 985533004: Implement chrome.fileSystem.requestFileSystem(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed kiosk mode. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698