diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 14:45:05 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 14:45:05 +0000 |
commit | 0753db59d038d9a7feaf11f02e4df7587a2b4d1f (patch) | |
tree | 338094b1771c1a9d82e74e5c743d924fb01b44ec /chrome_frame/navigation_constraints.cc | |
parent | 74ca044ddeb27bca294a88f397e85429ce28e2b6 (diff) | |
download | chromium_src-0753db59d038d9a7feaf11f02e4df7587a2b4d1f.zip chromium_src-0753db59d038d9a7feaf11f02e4df7587a2b4d1f.tar.gz chromium_src-0753db59d038d9a7feaf11f02e4df7587a2b4d1f.tar.bz2 |
Fixing a regression introduced with r69101, which now prevents Chrome Frame
from loading chrome extension URL in privileged mode using the NPAPI plugin.
The behaviour that was implemented only for the ActiveX control has been
moved into the base class NavigationConstraintsImpl, which both the ActieX
and NPAPI plugin derive from.
TEST=Added new unit tests for this case
BUG=0
Review URL: http://codereview.chromium.org/5814004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69257 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/navigation_constraints.cc')
-rw-r--r-- | chrome_frame/navigation_constraints.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome_frame/navigation_constraints.cc b/chrome_frame/navigation_constraints.cc index 0845bb1..78bd8df 100644 --- a/chrome_frame/navigation_constraints.cc +++ b/chrome_frame/navigation_constraints.cc @@ -9,6 +9,9 @@ #include "chrome/common/url_constants.h" #include "chrome_frame/utils.h" +NavigationConstraintsImpl::NavigationConstraintsImpl() : is_privileged_(false) { +} + // NavigationConstraintsImpl method definitions. bool NavigationConstraintsImpl::AllowUnsafeUrls() { // No sanity checks if unsafe URLs are allowed @@ -42,6 +45,13 @@ bool NavigationConstraintsImpl::IsSchemeAllowed(const GURL& url) { return true; } } + + if (is_privileged_ && + (url.SchemeIs(chrome::kDataScheme) || + url.SchemeIs(chrome::kExtensionScheme))) { + return true; + } + return false; } @@ -67,3 +77,10 @@ bool NavigationConstraintsImpl::IsZoneAllowed(const GURL& url) { return true; } +bool NavigationConstraintsImpl::is_privileged() const { + return is_privileged_; +} + +void NavigationConstraintsImpl::set_is_privileged(bool is_privileged) { + is_privileged_ = is_privileged; +} |