Index: extensions/renderer/resources/extension_custom_bindings.js |
diff --git a/extensions/renderer/resources/extension_custom_bindings.js b/extensions/renderer/resources/extension_custom_bindings.js |
index 68450d56b3afbbf6fe39b44c9898274060e0be8b..668f821ba47a3ff35ee1bda14db9478d29297738 100644 |
--- a/extensions/renderer/resources/extension_custom_bindings.js |
+++ b/extensions/renderer/resources/extension_custom_bindings.js |
@@ -22,6 +22,7 @@ var manifestVersion = requireNative('process').GetManifestVersion(); |
// chrome.windows API won't exist unless this extension has permission for it; |
// which may not be the case. |
var WINDOW_ID_NONE = -1; |
+var TAB_ID_NONE = -1; |
binding.registerCustomHook(function(bindingsAPI, extensionId) { |
var extension = bindingsAPI.compiledApi; |
@@ -35,6 +36,7 @@ binding.registerCustomHook(function(bindingsAPI, extensionId) { |
apiFunctions.setHandleRequest('getViews', function(properties) { |
var windowId = WINDOW_ID_NONE; |
+ var tabId = TAB_ID_NONE; |
var type = 'ALL'; |
if (properties) { |
if (properties.type != null) { |
@@ -43,18 +45,21 @@ binding.registerCustomHook(function(bindingsAPI, extensionId) { |
if (properties.windowId != null) { |
windowId = properties.windowId; |
} |
+ if (properties.tabId != null) { |
+ tabId = properties.tabId; |
+ } |
} |
- return GetExtensionViews(windowId, type); |
+ return GetExtensionViews(windowId, type, tabId); |
}); |
apiFunctions.setHandleRequest('getBackgroundPage', function() { |
- return GetExtensionViews(-1, 'BACKGROUND')[0] || null; |
+ return GetExtensionViews(-1, 'BACKGROUND', -1)[0] || null; |
}); |
apiFunctions.setHandleRequest('getExtensionTabs', function(windowId) { |
if (windowId == null) |
windowId = WINDOW_ID_NONE; |
- return GetExtensionViews(windowId, 'TAB'); |
+ return GetExtensionViews(windowId, 'TAB', -1); |
}); |
apiFunctions.setHandleRequest('getURL', function(path) { |