diff options
author | miket@chromium.org <miket@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-28 00:25:15 +0000 |
---|---|---|
committer | miket@chromium.org <miket@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-28 00:25:15 +0000 |
commit | 2d62310296eb3c7eb6f92d7eb699dafa5450dac8 (patch) | |
tree | 10bb322e2b635b3100aa48874cdfc6d73e7f139e /chrome/browser/extensions/extension_tabs_module.cc | |
parent | 6ccd0de45b86d609168b2138c750ef315b163df9 (diff) | |
download | chromium_src-2d62310296eb3c7eb6f92d7eb699dafa5450dac8.zip chromium_src-2d62310296eb3c7eb6f92d7eb699dafa5450dac8.tar.gz chromium_src-2d62310296eb3c7eb6f92d7eb699dafa5450dac8.tar.bz2 |
chrome.tabs.update now returns null Tab when no tabs permission.
BUG=97674
TEST=added a test extension with permissions, enhanced an existing one.
Review URL: http://codereview.chromium.org/7967021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103059 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_tabs_module.cc')
-rw-r--r-- | chrome/browser/extensions/extension_tabs_module.cc | 13 |
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; |