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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 // the rest of the API. See crbug/29215 . | 1013 // the rest of the API. See crbug/29215 . |
1014 if (arguments.length == 2 && typeof(arguments[1]) == "function") { | 1014 if (arguments.length == 2 && typeof(arguments[1]) == "function") { |
1015 // If the old signature is used, add a null details object. | 1015 // If the old signature is used, add a null details object. |
1016 newArgs = [arguments[0], null, arguments[1]]; | 1016 newArgs = [arguments[0], null, arguments[1]]; |
1017 } else { | 1017 } else { |
1018 newArgs = arguments; | 1018 newArgs = arguments; |
1019 } | 1019 } |
1020 return newArgs; | 1020 return newArgs; |
1021 }; | 1021 }; |
1022 | 1022 |
| 1023 apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"]. |
| 1024 updateArgumentsPreValidate = function() { |
| 1025 // Delete properties that are objects in order to be able to serialize |
| 1026 var arg1 = arguments[1]; |
| 1027 |
| 1028 for (prop in arg1) |
| 1029 if (typeof arg1[prop] == "object") |
| 1030 delete arg1[prop]; |
| 1031 |
| 1032 return arguments; |
| 1033 }; |
| 1034 |
| 1035 apiFunctions["experimental.offscreenTabs.sendMouseEvent"]. |
| 1036 updateArgumentsPreValidate = |
| 1037 apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"]. |
| 1038 updateArgumentsPreValidate; |
| 1039 |
1023 apiFunctions["omnibox.sendSuggestions"].updateArgumentsPostValidate = | 1040 apiFunctions["omnibox.sendSuggestions"].updateArgumentsPostValidate = |
1024 function(requestId, userSuggestions) { | 1041 function(requestId, userSuggestions) { |
1025 var suggestions = []; | 1042 var suggestions = []; |
1026 for (var i = 0; i < userSuggestions.length; i++) { | 1043 for (var i = 0; i < userSuggestions.length; i++) { |
1027 var parseResult = parseOmniboxDescription( | 1044 var parseResult = parseOmniboxDescription( |
1028 userSuggestions[i].description); | 1045 userSuggestions[i].description); |
1029 parseResult.content = userSuggestions[i].content; | 1046 parseResult.content = userSuggestions[i].content; |
1030 suggestions.push(parseResult); | 1047 suggestions.push(parseResult); |
1031 } | 1048 } |
1032 return [requestId, suggestions]; | 1049 return [requestId, suggestions]; |
(...skipping 30 matching lines...) Expand all Loading... |
1063 | 1080 |
1064 if (!chrome.tts) | 1081 if (!chrome.tts) |
1065 chrome.tts = {}; | 1082 chrome.tts = {}; |
1066 | 1083 |
1067 if (!chrome.ttsEngine) | 1084 if (!chrome.ttsEngine) |
1068 chrome.ttsEngine = {}; | 1085 chrome.ttsEngine = {}; |
1069 | 1086 |
1070 if (!chrome.experimental.downloads) | 1087 if (!chrome.experimental.downloads) |
1071 chrome.experimental.downloads = {}; | 1088 chrome.experimental.downloads = {}; |
1072 })(); | 1089 })(); |
OLD | NEW |