summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_activex_base.h
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 14:45:05 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 14:45:05 +0000
commit0753db59d038d9a7feaf11f02e4df7587a2b4d1f (patch)
tree338094b1771c1a9d82e74e5c743d924fb01b44ec /chrome_frame/chrome_frame_activex_base.h
parent74ca044ddeb27bca294a88f397e85429ce28e2b6 (diff)
downloadchromium_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/chrome_frame_activex_base.h')
-rw-r--r--chrome_frame/chrome_frame_activex_base.h38
1 files changed, 11 insertions, 27 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h
index 7d39a7e5..dfc3da0 100644
--- a/chrome_frame/chrome_frame_activex_base.h
+++ b/chrome_frame/chrome_frame_activex_base.h
@@ -29,7 +29,6 @@
#include "chrome_frame/chrome_frame_plugin.h"
#include "chrome_frame/com_message_event.h"
#include "chrome_frame/com_type_info_holder.h"
-#include "chrome_frame/navigation_constraints.h"
#include "chrome_frame/simple_resource_loader.h"
#include "chrome_frame/urlmon_url_request.h"
#include "chrome_frame/urlmon_url_request_private.h"
@@ -170,8 +169,7 @@ class ATL_NO_VTABLE ChromeFrameActivexBase : // NOLINT
public IPropertyNotifySinkCP<T>,
public CComCoClass<T, &class_id>,
public CComControl<T>,
- public ChromeFramePlugin<T>,
- public NavigationConstraintsImpl {
+ public ChromeFramePlugin<T> {
protected:
typedef std::set<base::win::ScopedComPtr<IDispatch> > EventHandlers;
typedef ChromeFrameActivexBase<T, class_id> BasePlugin;
@@ -388,7 +386,7 @@ END_MSG_MAP()
// The base implementation returns true unless we are in privileged
// mode, in which case we always trust our container so we return false.
bool is_frame_busting_enabled() const {
- return !is_privileged_;
+ return !is_privileged();
}
// Needed to support PostTask.
@@ -494,7 +492,7 @@ END_MSG_MAP()
// passing mechanism between this CF instance, and the BHO that will
// be constructed in the new IE tab.
if (parsed_url.SchemeIs("chrome-extension") &&
- is_privileged_) {
+ is_privileged()) {
const char kScheme[] = "http";
const char kHost[] = "local_host";
@@ -573,20 +571,6 @@ END_MSG_MAP()
Fire_onclose();
}
- // NavigationConstraints overrides.
- virtual bool IsSchemeAllowed(const GURL& url) {
- bool allowed = NavigationConstraintsImpl::IsSchemeAllowed(url);
- if (allowed)
- return true;
-
- if (is_privileged_ &&
- (url.SchemeIs(chrome::kDataScheme) ||
- url.SchemeIs(chrome::kExtensionScheme))) {
- return true;
- }
- return false;
- }
-
// Overridden to take advantage of readystate prop changes and send those
// to potential listeners.
HRESULT FireOnChanged(DISPID dispid) {
@@ -733,7 +717,7 @@ END_MSG_MAP()
}
STDMETHOD(put_useChromeNetwork)(VARIANT_BOOL use_chrome_network) {
- if (!is_privileged_) {
+ if (!is_privileged()) {
DLOG(ERROR) << "Attempt to set useChromeNetwork in non-privileged mode";
return E_ACCESSDENIED;
}
@@ -830,7 +814,7 @@ END_MSG_MAP()
if (NULL == message)
return E_INVALIDARG;
- if (!is_privileged_) {
+ if (!is_privileged()) {
DLOG(ERROR) << "Attempt to postPrivateMessage in non-privileged mode";
return E_ACCESSDENIED;
}
@@ -859,7 +843,7 @@ END_MSG_MAP()
return E_INVALIDARG;
}
- if (!is_privileged_) {
+ if (!is_privileged()) {
DLOG(ERROR) << "Attempt to installExtension in non-privileged mode";
return E_ACCESSDENIED;
}
@@ -879,7 +863,7 @@ END_MSG_MAP()
return E_INVALIDARG;
}
- if (!is_privileged_) {
+ if (!is_privileged()) {
DLOG(ERROR) << "Attempt to loadExtension in non-privileged mode";
return E_ACCESSDENIED;
}
@@ -894,7 +878,7 @@ END_MSG_MAP()
STDMETHOD(getEnabledExtensions)() {
DCHECK(automation_client_.get());
- if (!is_privileged_) {
+ if (!is_privileged()) {
DLOG(ERROR) << "Attempt to getEnabledExtensions in non-privileged mode";
return E_ACCESSDENIED;
}
@@ -907,7 +891,7 @@ END_MSG_MAP()
DCHECK(automation_client_.get());
DCHECK(session_id);
- if (!is_privileged_) {
+ if (!is_privileged()) {
DLOG(ERROR) << "Attempt to getSessionId in non-privileged mode";
return E_ACCESSDENIED;
}
@@ -941,7 +925,7 @@ END_MSG_MAP()
} else if (LowerCaseEqualsASCII(event_type, event_type_end,
"privatemessage")) {
// This event handler is only available in privileged mode.
- if (is_privileged_) {
+ if (is_privileged()) {
*handlers = &onprivatemessage_;
} else {
Error("Event type 'privatemessage' is privileged");
@@ -950,7 +934,7 @@ END_MSG_MAP()
} else if (LowerCaseEqualsASCII(event_type, event_type_end,
"extensionready")) {
// This event handler is only available in privileged mode.
- if (is_privileged_) {
+ if (is_privileged()) {
*handlers = &onextensionready_;
} else {
Error("Event type 'extensionready' is privileged");