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

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

Issue 23903016: file_manager: Rename root_path to root_url (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 fileBrowserPrivate API. 5 // Custom binding for the fileBrowserPrivate API.
6 6
7 var binding = require('binding').Binding.create('fileBrowserPrivate'); 7 var binding = require('binding').Binding.create('fileBrowserPrivate');
8 8
9 var fileBrowserPrivateNatives = requireNative('file_browser_private'); 9 var fileBrowserPrivateNatives = requireNative('file_browser_private');
10 var GetFileSystem = fileBrowserPrivateNatives.GetFileSystem; 10 var GetFileSystem = fileBrowserPrivateNatives.GetFileSystem;
11 11
12 var fileBrowserNatives = requireNative('file_browser_handler'); 12 var fileBrowserNatives = requireNative('file_browser_handler');
13 var GetExternalFileEntry = fileBrowserNatives.GetExternalFileEntry; 13 var GetExternalFileEntry = fileBrowserNatives.GetExternalFileEntry;
14 14
15 binding.registerCustomHook(function(bindingsAPI) { 15 binding.registerCustomHook(function(bindingsAPI) {
16 var apiFunctions = bindingsAPI.apiFunctions; 16 var apiFunctions = bindingsAPI.apiFunctions;
17 17
18 apiFunctions.setCustomCallback('requestFileSystem', 18 apiFunctions.setCustomCallback('requestFileSystem',
19 function(name, request, response) { 19 function(name, request, response) {
20 var fs = null; 20 var fs = null;
21 if (response && !response.error) 21 if (response && !response.error)
22 fs = GetFileSystem(response.name, response.path); 22 fs = GetFileSystem(response.name, response.root_url);
23 if (request.callback) 23 if (request.callback)
24 request.callback(fs); 24 request.callback(fs);
25 request.callback = null; 25 request.callback = null;
26 }); 26 });
27 27
28 apiFunctions.setCustomCallback('searchDrive', 28 apiFunctions.setCustomCallback('searchDrive',
29 function(name, request, response) { 29 function(name, request, response) {
30 if (response && !response.error && response.entries) { 30 if (response && !response.error && response.entries) {
31 response.entries = response.entries.map(function(entry) { 31 response.entries = response.entries.map(function(entry) {
32 return GetExternalFileEntry(entry); 32 return GetExternalFileEntry(entry);
(...skipping 22 matching lines...) Expand all
55 if (!response) 55 if (!response)
56 response = {}; 56 response = {};
57 57
58 if (request.callback) 58 if (request.callback)
59 request.callback(response); 59 request.callback(response);
60 request.callback = null; 60 request.callback = null;
61 }); 61 });
62 }); 62 });
63 63
64 exports.binding = binding.generate(); 64 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698