OLD | NEW |
1 // Copyright (c) 2009 The chrome Authors. All rights reserved. | 1 // Copyright (c) 2009 The chrome 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 // ----------------------------------------------------------------------------- | 5 // ----------------------------------------------------------------------------- |
6 // NOTE: If you change this file you need to touch renderer_resources.grd to | 6 // NOTE: If you change this file you need to touch renderer_resources.grd to |
7 // have your change take effect. | 7 // have your change take effect. |
8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
9 | 9 |
10 // This script contains privileged chrome extension related javascript APIs. | 10 // This script contains privileged chrome extension related javascript APIs. |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 return GetExtensionViews(windowId, "TOOLSTRIP"); | 274 return GetExtensionViews(windowId, "TOOLSTRIP"); |
275 } | 275 } |
276 | 276 |
277 apiFunctions["extension.getTabContentses"].handleRequest = | 277 apiFunctions["extension.getTabContentses"].handleRequest = |
278 function(windowId) { | 278 function(windowId) { |
279 if (typeof(windowId) == "undefined") | 279 if (typeof(windowId) == "undefined") |
280 windowId = -1; | 280 windowId = -1; |
281 return GetExtensionViews(windowId, "TAB"); | 281 return GetExtensionViews(windowId, "TAB"); |
282 } | 282 } |
283 | 283 |
| 284 apiFunctions["devtools.getTabEvents"].handleRequest = function(tabId) { |
| 285 var tabIdProxy = {}; |
| 286 forEach(["onPageEvent", "onTabUrlChange", "onTabClose"], |
| 287 function(name) { |
| 288 // Event disambiguation is handled by name munging. See |
| 289 // chrome/browser/extensions/extension_devtools_events.h for the C++ |
| 290 // equivalent of this logic. |
| 291 tabIdProxy[name] = new chrome.Event("devtools." + tabId + "." + name); |
| 292 }); |
| 293 return tabIdProxy; |
| 294 } |
| 295 |
284 setupPageActionEvents(extensionId); | 296 setupPageActionEvents(extensionId); |
285 }); | 297 }); |
286 })(); | 298 })(); |
OLD | NEW |