summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_function_dispatcher.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 06:28:15 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 06:28:15 +0000
commitc7ad50f409be00bda164b2f60c29e2733eed1c94 (patch)
treeaed183fbb1b944e6ef18c87e77cb49370ace834b /chrome/browser/extensions/extension_function_dispatcher.cc
parent7e922f33d88905196067d901a14910a62c48ac21 (diff)
downloadchromium_src-c7ad50f409be00bda164b2f60c29e2733eed1c94.zip
chromium_src-c7ad50f409be00bda164b2f60c29e2733eed1c94.tar.gz
chromium_src-c7ad50f409be00bda164b2f60c29e2733eed1c94.tar.bz2
Don't allow updating tabs to javascript URLs without host
permissions to that tab. Cleaned up a few things along the way: - added a GetExtension() method to ExtensionFunctionDispatcher and ExtensionFunction since it was used in more than one place. - Removed first param from chrome.test.failCallback() since it wasn't used anywhere. - Added a convenience CanAccessHost() method to Extension, since it seems likely to be commonly used. - Refactored setup of mock host resolver in browsertest, since the way it was, you could only customize it at the testsuite level, not the test level. Review URL: http://codereview.chromium.org/199074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_function_dispatcher.cc')
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 276dd16..36f4192 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -251,6 +251,16 @@ ExtensionHost* ExtensionFunctionDispatcher::GetExtensionHost() {
return delegate_->GetExtensionHost();
}
+Extension* ExtensionFunctionDispatcher::GetExtension() {
+ ExtensionsService* service = profile()->GetExtensionsService();
+ DCHECK(service);
+
+ Extension* extension = service->GetExtensionById(extension_id());
+ DCHECK(extension);
+
+ return extension;
+}
+
void ExtensionFunctionDispatcher::HandleRequest(const std::string& name,
const std::string& args,
int request_id,