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

Side by Side Diff: chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js

Issue 12313142: Revert 184837 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom binding for the syncFileSystem API. 5 // Custom bindings for the syncFileSystem API.
6
7 var binding = require('binding').Binding.create('syncFileSystem');
8 6
9 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
10 var fileSystemNatives = requireNative('file_system_natives'); 8 var fileSystemNatives = requireNative('file_system_natives');
11 var syncFileSystemNatives = requireNative('sync_file_system'); 9 var syncFileSystemNatives = requireNative('sync_file_system');
12 10
13 binding.registerCustomHook(function(bindingsAPI) { 11 chromeHidden.registerCustomHook('syncFileSystem', function(bindingsAPI) {
14 var apiFunctions = bindingsAPI.apiFunctions; 12 var apiFunctions = bindingsAPI.apiFunctions;
15 13
16 // Functions which take in an [instanceOf=FileEntry]. 14 // Functions which take in an [instanceOf=FileEntry].
17 function bindFileEntryFunction(functionName) { 15 function bindFileEntryFunction(functionName) {
18 apiFunctions.setUpdateArgumentsPostValidate( 16 apiFunctions.setUpdateArgumentsPostValidate(
19 functionName, function(entry, callback) { 17 functionName, function(entry, callback) {
20 var fileSystemUrl = entry.toURL(); 18 var fileSystemUrl = entry.toURL();
21 return [fileSystemUrl, callback]; 19 return [fileSystemUrl, callback];
22 }); 20 });
23 } 21 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Combine into a single dictionary. 60 // Combine into a single dictionary.
63 var fileInfo = new Object(); 61 var fileInfo = new Object();
64 fileInfo.fileEntry = fileEntry; 62 fileInfo.fileEntry = fileEntry;
65 fileInfo.status = args[4]; 63 fileInfo.status = args[4];
66 if (fileInfo.status == "synced") { 64 if (fileInfo.status == "synced") {
67 fileInfo.action = args[5]; 65 fileInfo.action = args[5];
68 fileInfo.direction = args[6]; 66 fileInfo.direction = args[6];
69 } 67 }
70 dispatch([fileInfo]); 68 dispatch([fileInfo]);
71 }); 69 });
72
73 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698