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

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

Issue 132313009: New API to copy syncfs folder to localfs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 6 years, 11 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
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/resources/renderer_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a03bf36aea0b40ebbbb99d40a63129a76ef763af
--- /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) {
+ var fileSystemName = directoryEntry.filesystem.name;
+ var relativePath = $String.slice(directoryEntry.fullPath, 1);
+ var url = directoryEntry.toURL();
+ return [fileSystemName, relativePath, url, callback];
+ });
+ }
+
+ bindFileSystemFunction('loadDirectory');
+
+});
+
+exports.binding = binding.generate();
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/resources/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698