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

Unified Diff: chrome/renderer/resources/extensions/file_system_custom_bindings.js

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/renderer/resources/extensions/file_system_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/file_system_custom_bindings.js b/chrome/renderer/resources/extensions/file_system_custom_bindings.js
index 30a8aca48e2726a733d39f4ab179a3771ade8e95..5553ae93776113577a4939eccf914cd1b852701e 100644
--- a/chrome/renderer/resources/extensions/file_system_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/file_system_custom_bindings.js
@@ -12,6 +12,7 @@ var getFileBindingsForApi =
var fileBindings = getFileBindingsForApi('fileSystem');
var bindFileEntryCallback = fileBindings.bindFileEntryCallback;
var entryIdManager = fileBindings.entryIdManager;
+var fileSystemNatives = requireNative('file_system_natives');
binding.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
@@ -79,6 +80,20 @@ binding.registerCustomHook(function(bindingsAPI) {
}
});
+ apiFunctions.setCustomCallback('requestFileSystem',
+ function(name, request, callback, response) {
+ var fileSystem = null;
+ if (response && response.file_system_id) {
+ fileSystem = fileSystemNatives.GetIsolatedFileSystem(
+ response.file_system_id, response.file_system_path);
+ }
+ sendRequest.safeCallbackApply(
+ 'fileSystem.requestFileSystem',
+ request,
+ callback,
+ [fileSystem]);
+ });
+
// TODO(benwells): Remove these deprecated versions of the functions.
fileSystem.getWritableFileEntry = function() {
console.log("chrome.fileSystem.getWritableFileEntry is deprecated");

Powered by Google App Engine
This is Rietveld 408576698