summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension.h
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/common/extensions/extension.h
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/common/extensions/extension.h')
-rw-r--r--chrome/common/extensions/extension.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index e8cdd10..5116bd3 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -199,12 +199,16 @@ class Extension {
const std::vector<PluginInfo>& plugins() const { return plugins_; }
const GURL& background_url() const { return background_url_; }
const std::vector<ToolstripInfo>& toolstrips() const { return toolstrips_; }
- const HostPermissions& host_permissions() const {
- return host_permissions_;
- }
const std::vector<std::string>& api_permissions() const {
return api_permissions_;
}
+ const HostPermissions& host_permissions() const {
+ return host_permissions_;
+ }
+
+ // Returns true if the extension has permission to access the host for the
+ // specified URL.
+ bool CanAccessHost(const GURL& url) const;
// Returns the set of hosts that the extension effectively has access to. This
// is used in the permissions UI and is a combination of the hosts accessible