| 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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 var parseResult = parseOmniboxDescription( | 1003 var parseResult = parseOmniboxDescription( |
| 1004 userSuggestions[i].description); | 1004 userSuggestions[i].description); |
| 1005 parseResult.content = userSuggestions[i].content; | 1005 parseResult.content = userSuggestions[i].content; |
| 1006 suggestions.push(parseResult); | 1006 suggestions.push(parseResult); |
| 1007 } | 1007 } |
| 1008 return [requestId, suggestions]; | 1008 return [requestId, suggestions]; |
| 1009 }; | 1009 }; |
| 1010 | 1010 |
| 1011 apiFunctions["experimental.tts.speak"].handleRequest = function() { | 1011 apiFunctions["experimental.tts.speak"].handleRequest = function() { |
| 1012 var args = arguments; | 1012 var args = arguments; |
| 1013 if (args.length > 1 && args[1] && args[1].onevent) { | 1013 if (args.length > 1 && args[1] && args[1].onEvent) { |
| 1014 var id = GetNextTtsEventId(); | 1014 var id = GetNextTtsEventId(); |
| 1015 args[1].srcId = id; | 1015 args[1].srcId = id; |
| 1016 chromeHidden.tts.handlers[id] = args[1].onevent; | 1016 chromeHidden.tts.handlers[id] = args[1].onEvent; |
| 1017 } | 1017 } |
| 1018 sendRequest(this.name, args, this.definition.parameters); | 1018 sendRequest(this.name, args, this.definition.parameters); |
| 1019 return id; | 1019 return id; |
| 1020 }; | 1020 }; |
| 1021 | 1021 |
| 1022 if (chrome.test) { | 1022 if (chrome.test) { |
| 1023 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; | 1023 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 setupPageActionEvents(extensionId); | 1026 setupPageActionEvents(extensionId); |
| 1027 setupToolstripEvents(GetRenderViewId()); | 1027 setupToolstripEvents(GetRenderViewId()); |
| 1028 setupHiddenContextMenuEvent(extensionId); | 1028 setupHiddenContextMenuEvent(extensionId); |
| 1029 setupOmniboxEvents(); | 1029 setupOmniboxEvents(); |
| 1030 setupTtsEvents(); | 1030 setupTtsEvents(); |
| 1031 }); | 1031 }); |
| 1032 | 1032 |
| 1033 if (!chrome.experimental) | 1033 if (!chrome.experimental) |
| 1034 chrome.experimental = {}; | 1034 chrome.experimental = {}; |
| 1035 | 1035 |
| 1036 if (!chrome.experimental.accessibility) | 1036 if (!chrome.experimental.accessibility) |
| 1037 chrome.experimental.accessibility = {}; | 1037 chrome.experimental.accessibility = {}; |
| 1038 | 1038 |
| 1039 if (!chrome.experimental.tts) | 1039 if (!chrome.experimental.tts) |
| 1040 chrome.experimental.tts = {}; | 1040 chrome.experimental.tts = {}; |
| 1041 | 1041 |
| 1042 if (!chrome.experimental.ttsEngine) | 1042 if (!chrome.experimental.ttsEngine) |
| 1043 chrome.experimental.ttsEngine = {}; | 1043 chrome.experimental.ttsEngine = {}; |
| 1044 })(); | 1044 })(); |
| OLD | NEW |