OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This script contains privileged chrome extension related javascript APIs. | 5 // This script contains privileged chrome extension related javascript APIs. |
6 // It is loaded by pages whose URL has the chrome-extension protocol. | 6 // It is loaded by pages whose URL has the chrome-extension protocol. |
7 | 7 |
8 var chrome = chrome || {}; | 8 var chrome = chrome || {}; |
9 (function() { | 9 (function() { |
10 native function GetExtensionAPIDefinition(); | 10 native function GetExtensionAPIDefinition(); |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 try { | 755 try { |
756 if (responseCallback) | 756 if (responseCallback) |
757 responseCallback(response); | 757 responseCallback(response); |
758 } finally { | 758 } finally { |
759 port.disconnect(); | 759 port.disconnect(); |
760 port = null; | 760 port = null; |
761 } | 761 } |
762 }); | 762 }); |
763 }; | 763 }; |
764 | 764 |
| 765 apiFunctions["experimental.downloads.download"].customCallback = |
| 766 function(name, request, response) { |
| 767 if (response) { |
| 768 response = chromeHidden.JSON.parse(response); |
| 769 } else { |
| 770 response = {}; |
| 771 } |
| 772 if (request.callback) { |
| 773 request.callback(response["id"], response["error"]); |
| 774 } |
| 775 request.callback = null; |
| 776 }; |
| 777 |
765 apiFunctions["fileBrowserPrivate.requestLocalFileSystem"].customCallback = | 778 apiFunctions["fileBrowserPrivate.requestLocalFileSystem"].customCallback = |
766 function(name, request, response) { | 779 function(name, request, response) { |
767 var resp = response ? [chromeHidden.JSON.parse(response)] : []; | 780 var resp = response ? [chromeHidden.JSON.parse(response)] : []; |
768 var fs = null; | 781 var fs = null; |
769 if (!resp[0].error) | 782 if (!resp[0].error) |
770 fs = GetLocalFileSystem(resp[0].name, resp[0].path); | 783 fs = GetLocalFileSystem(resp[0].name, resp[0].path); |
771 if (request.callback) | 784 if (request.callback) |
772 request.callback(fs); | 785 request.callback(fs); |
773 request.callback = null; | 786 request.callback = null; |
774 }; | 787 }; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 chrome.experimental = {}; | 1047 chrome.experimental = {}; |
1035 | 1048 |
1036 if (!chrome.experimental.accessibility) | 1049 if (!chrome.experimental.accessibility) |
1037 chrome.experimental.accessibility = {}; | 1050 chrome.experimental.accessibility = {}; |
1038 | 1051 |
1039 if (!chrome.experimental.tts) | 1052 if (!chrome.experimental.tts) |
1040 chrome.experimental.tts = {}; | 1053 chrome.experimental.tts = {}; |
1041 | 1054 |
1042 if (!chrome.experimental.ttsEngine) | 1055 if (!chrome.experimental.ttsEngine) |
1043 chrome.experimental.ttsEngine = {}; | 1056 chrome.experimental.ttsEngine = {}; |
| 1057 |
| 1058 if (!chrome.experimental.downloads) |
| 1059 chrome.experimental.downloads = {}; |
1044 })(); | 1060 })(); |
OLD | NEW |