| Index: chrome/renderer/resources/extensions/developer_private_custom_bindings.js
|
| diff --git a/chrome/renderer/resources/extensions/developer_private_custom_bindings.js b/chrome/renderer/resources/extensions/developer_private_custom_bindings.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..291d99c204beb3ac0d3924f5a7a7fc1927556b51
|
| --- /dev/null
|
| +++ b/chrome/renderer/resources/extensions/developer_private_custom_bindings.js
|
| @@ -0,0 +1,27 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// Custom binding for the developerPrivate API.
|
| +
|
| +var binding = require('binding').Binding.create('developerPrivate');
|
| +
|
| +binding.registerCustomHook(function(bindingsAPI) {
|
| + var apiFunctions = bindingsAPI.apiFunctions;
|
| +
|
| + // Converts the argument of |functionName| from DirectoryEntry to URL.
|
| + function bindFileSystemFunction(functionName) {
|
| + apiFunctions.setUpdateArgumentsPostValidate(
|
| + functionName, function(directoryEntry, callback) {
|
| + if (directoryEntry.toURL() != "")
|
| + return [directoryEntry.toURL(), callback];
|
| + else
|
| + return [directoryEntry.fullPath, callback];
|
| + });
|
| + }
|
| +
|
| + bindFileSystemFunction('loadDirectory');
|
| +
|
| +});
|
| +
|
| +exports.binding = binding.generate();
|
|
|