OLD | NEW |
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 fileSystem API. | 5 // Custom binding for the fileSystem API. |
6 | 6 |
7 var binding = require('binding').Binding.create('fileSystem'); | 7 var binding = require('binding').Binding.create('fileSystem'); |
8 var sendRequest = require('sendRequest'); | 8 var sendRequest = require('sendRequest'); |
9 | 9 |
10 var getFileBindingsForApi = | 10 var getFileBindingsForApi = |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 fileSystem = fileSystemNatives.GetIsolatedFileSystem( | 87 fileSystem = fileSystemNatives.GetIsolatedFileSystem( |
88 response.file_system_id, response.file_system_path); | 88 response.file_system_id, response.file_system_path); |
89 } | 89 } |
90 sendRequest.safeCallbackApply( | 90 sendRequest.safeCallbackApply( |
91 'fileSystem.requestFileSystem', | 91 'fileSystem.requestFileSystem', |
92 request, | 92 request, |
93 callback, | 93 callback, |
94 [fileSystem]); | 94 [fileSystem]); |
95 }); | 95 }); |
96 | 96 |
| 97 apiFunctions.setCustomCallback('getVolumeList', |
| 98 function(name, request, callback, response) { |
| 99 var volumeList = response || null; |
| 100 sendRequest.safeCallbackApply( |
| 101 'fileSystem.getVolumeList', |
| 102 request, |
| 103 callback, |
| 104 [volumeList]); |
| 105 }); |
| 106 |
97 // TODO(benwells): Remove these deprecated versions of the functions. | 107 // TODO(benwells): Remove these deprecated versions of the functions. |
98 fileSystem.getWritableFileEntry = function() { | 108 fileSystem.getWritableFileEntry = function() { |
99 console.log("chrome.fileSystem.getWritableFileEntry is deprecated"); | 109 console.log("chrome.fileSystem.getWritableFileEntry is deprecated"); |
100 console.log("Please use chrome.fileSystem.getWritableEntry instead"); | 110 console.log("Please use chrome.fileSystem.getWritableEntry instead"); |
101 $Function.apply(fileSystem.getWritableEntry, this, arguments); | 111 $Function.apply(fileSystem.getWritableEntry, this, arguments); |
102 }; | 112 }; |
103 | 113 |
104 fileSystem.isWritableFileEntry = function() { | 114 fileSystem.isWritableFileEntry = function() { |
105 console.log("chrome.fileSystem.isWritableFileEntry is deprecated"); | 115 console.log("chrome.fileSystem.isWritableFileEntry is deprecated"); |
106 console.log("Please use chrome.fileSystem.isWritableEntry instead"); | 116 console.log("Please use chrome.fileSystem.isWritableEntry instead"); |
107 $Function.apply(fileSystem.isWritableEntry, this, arguments); | 117 $Function.apply(fileSystem.isWritableEntry, this, arguments); |
108 }; | 118 }; |
109 | 119 |
110 fileSystem.chooseFile = function() { | 120 fileSystem.chooseFile = function() { |
111 console.log("chrome.fileSystem.chooseFile is deprecated"); | 121 console.log("chrome.fileSystem.chooseFile is deprecated"); |
112 console.log("Please use chrome.fileSystem.chooseEntry instead"); | 122 console.log("Please use chrome.fileSystem.chooseEntry instead"); |
113 $Function.apply(fileSystem.chooseEntry, this, arguments); | 123 $Function.apply(fileSystem.chooseEntry, this, arguments); |
114 }; | 124 }; |
115 }); | 125 }); |
116 | 126 |
117 exports.bindFileEntryCallback = bindFileEntryCallback; | 127 exports.bindFileEntryCallback = bindFileEntryCallback; |
118 exports.binding = binding.generate(); | 128 exports.binding = binding.generate(); |
OLD | NEW |