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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 try { | 735 try { |
736 if (responseCallback) | 736 if (responseCallback) |
737 responseCallback(response); | 737 responseCallback(response); |
738 } finally { | 738 } finally { |
739 port.disconnect(); | 739 port.disconnect(); |
740 port = null; | 740 port = null; |
741 } | 741 } |
742 }); | 742 }); |
743 }; | 743 }; |
744 | 744 |
745 apiFunctions["experimental.downloads.download"].customCallback = | |
Sam Kerner (Chrome)
2011/06/21 03:37:40
Why do you need to set a custom callback?
bSh
2011/06/24 19:46:25
This is the only way to pass more than one paramet
| |
746 function(name, request, response) { | |
747 if (response) { | |
748 response = chromeHidden.JSON.parse(response); | |
749 } else { | |
750 response = {}; | |
751 } | |
752 if (request.callback) { | |
753 request.callback(response["id"], response["error"]); | |
754 } | |
755 request.callback = null; | |
756 }; | |
757 | |
745 apiFunctions["fileBrowserPrivate.requestLocalFileSystem"].customCallback = | 758 apiFunctions["fileBrowserPrivate.requestLocalFileSystem"].customCallback = |
746 function(name, request, response) { | 759 function(name, request, response) { |
747 var resp = response ? [chromeHidden.JSON.parse(response)] : []; | 760 var resp = response ? [chromeHidden.JSON.parse(response)] : []; |
748 var fs = null; | 761 var fs = null; |
749 if (!resp[0].error) | 762 if (!resp[0].error) |
750 fs = GetLocalFileSystem(resp[0].name, resp[0].path); | 763 fs = GetLocalFileSystem(resp[0].name, resp[0].path); |
751 if (request.callback) | 764 if (request.callback) |
752 request.callback(fs); | 765 request.callback(fs); |
753 request.callback = null; | 766 request.callback = null; |
754 }; | 767 }; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1001 | 1014 |
1002 if (!chrome.experimental) | 1015 if (!chrome.experimental) |
1003 chrome.experimental = {}; | 1016 chrome.experimental = {}; |
1004 | 1017 |
1005 if (!chrome.experimental.accessibility) | 1018 if (!chrome.experimental.accessibility) |
1006 chrome.experimental.accessibility = {}; | 1019 chrome.experimental.accessibility = {}; |
1007 | 1020 |
1008 if (!chrome.experimental.tts) | 1021 if (!chrome.experimental.tts) |
1009 chrome.experimental.tts = {}; | 1022 chrome.experimental.tts = {}; |
1010 })(); | 1023 })(); |
OLD | NEW |