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 29e20e764e3785693efad3ceff44b0c9205dc295..ea1c5aed68f138c478085a230f7d16dac0cc4aeb 100644 |
--- a/chrome/renderer/resources/extensions/file_system_custom_bindings.js |
+++ b/chrome/renderer/resources/extensions/file_system_custom_bindings.js |
@@ -4,14 +4,18 @@ |
// Custom bindings for the fileSystem API. |
-var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
+var Bindings = require('schema_binding_generator').Bindings; |
+var bindings = new Bindings('fileSystem'); |
+ |
var fileSystemNatives = requireNative('file_system_natives'); |
var GetIsolatedFileSystem = fileSystemNatives.GetIsolatedFileSystem; |
var lastError = require('lastError'); |
var entryIdManager = require('entryIdManager'); |
-chromeHidden.registerCustomHook('fileSystem', function(bindingsAPI) { |
+bindings.registerCustomHook(function(bindingsAPI) { |
var apiFunctions = bindingsAPI.apiFunctions; |
+ var fileSystem = bindingsAPI.compiledApi; |
+ |
function bindFileEntryFunction(functionName) { |
apiFunctions.setUpdateArgumentsPostValidate( |
functionName, function(fileEntry, callback) { |
@@ -65,21 +69,23 @@ chromeHidden.registerCustomHook('fileSystem', function(bindingsAPI) { |
}); |
// TODO(benwells): Remove these deprecated versions of the functions. |
- chrome.fileSystem.getWritableFileEntry = function() { |
+ fileSystem.getWritableFileEntry = function() { |
console.log("chrome.fileSystem.getWritableFileEntry is deprecated"); |
console.log("Please use chrome.fileSystem.getWritableEntry instead"); |
- chrome.fileSystem.getWritableEntry.apply(this, arguments); |
+ fileSystem.getWritableEntry.apply(this, arguments); |
}; |
- chrome.fileSystem.isWritableFileEntry = function() { |
+ fileSystem.isWritableFileEntry = function() { |
console.log("chrome.fileSystem.isWritableFileEntry is deprecated"); |
console.log("Please use chrome.fileSystem.isWritableEntry instead"); |
- chrome.fileSystem.isWritableEntry.apply(this, arguments); |
+ fileSystem.isWritableEntry.apply(this, arguments); |
}; |
- chrome.fileSystem.chooseFile = function() { |
+ fileSystem.chooseFile = function() { |
console.log("chrome.fileSystem.chooseFile is deprecated"); |
console.log("Please use chrome.fileSystem.chooseEntry instead"); |
- chrome.fileSystem.chooseEntry.apply(this, arguments); |
+ fileSystem.chooseEntry.apply(this, arguments); |
}; |
}); |
+ |
+exports.bindings = bindings.generate(); |