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

Side by Side 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: added syncfs checkes 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Custom binding for the developerPrivate API.
6
7 var binding = require('binding').Binding.create('developerPrivate');
8
9 binding.registerCustomHook(function(bindingsAPI) {
10 var apiFunctions = bindingsAPI.apiFunctions;
11
12 // Converts the argument of |functionName| from DirectoryEntry to URL.
13 function bindFileSystemFunction(functionName) {
14 apiFunctions.setUpdateArgumentsPostValidate(
15 functionName, function(directoryEntry, callback) {
16 // toURL returns non-empty strings for syncfs directories.
17 if (directoryEntry.toURL() != "")
18 return [directoryEntry.toURL(), callback];
19 else
20 return [directoryEntry.fullPath, callback];
21 });
22 }
23
24 bindFileSystemFunction('loadDirectory');
25
26 });
27
28 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698