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