summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_tabs_module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_tabs_module.cc')
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 7367e77..5f55e70 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -816,10 +816,15 @@ bool UpdateTabFunction::RunImpl() {
tab_index = tab_strip->GetIndexOfTabContents(contents);
}
- if (has_callback())
- result_.reset(ExtensionTabUtil::CreateTabValue(contents->tab_contents(),
- tab_strip,
- tab_index));
+ if (has_callback()) {
+ if (GetExtension()->HasAPIPermission(ExtensionAPIPermission::kTab)) {
+ result_.reset(ExtensionTabUtil::CreateTabValue(contents->tab_contents(),
+ tab_strip,
+ tab_index));
+ } else {
+ result_.reset(Value::CreateNullValue());
+ }
+ }
SendResponse(true);
return true;