diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-05-09 01:59:07 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-05-09 01:59:07 +0800 |
commit | db6332110ee1fa475515cfee88c57d5d0aa9ce1d (patch) | |
tree | bce91587e8d1688c3982f854096af48f08c3637c /embed/mozilla/EphyBrowser.cpp | |
parent | 79f63d46a39524f075af29e753cc23e5e699ecb8 (diff) | |
download | gsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.tar.gz gsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.tar.zst gsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.zip |
More trusted checks.
2005-05-08 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EventContext.cpp:
More trusted checks.
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 257624e95..0f70367a3 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -133,6 +133,15 @@ EphyEventListener::Init (EphyBrowser *aOwner) NS_IMETHODIMP EphyDOMLinkEventListener::HandleEvent (nsIDOMEvent* aDOMEvent) { +#ifdef MOZ_NSIDOMNSEVENT_GETISTRUSTED + /* make sure the event is trusted */ + nsCOMPtr<nsIDOMNSEvent> nsEvent (do_QueryInterface (aDOMEvent)); + NS_ENSURE_TRUE (nsEvent, NS_ERROR_FAILURE); + PRBool isTrusted = PR_FALSE; + nsEvent->GetIsTrusted (&isTrusted); + if (!isTrusted) return NS_OK; +#endif /* MOZ_NSIDOMNSEVENT_GETISTRUSTED */ + nsCOMPtr<nsIDOMEventTarget> eventTarget; aDOMEvent->GetTarget(getter_AddRefs(eventTarget)); @@ -303,6 +312,15 @@ EphyDOMLinkEventListener::GetDocURI (nsIDOMElement *aElement, NS_IMETHODIMP EphyPopupBlockEventListener::HandleEvent (nsIDOMEvent * aDOMEvent) { +#ifdef MOZ_NSIDOMNSEVENT_GETISTRUSTED + /* make sure the event is trusted */ + nsCOMPtr<nsIDOMNSEvent> nsEvent (do_QueryInterface (aDOMEvent)); + NS_ENSURE_TRUE (nsEvent, NS_ERROR_FAILURE); + PRBool isTrusted = PR_FALSE; + nsEvent->GetIsTrusted (&isTrusted); + if (!isTrusted) return NS_OK; +#endif /* MOZ_NSIDOMNSEVENT_GETISTRUSTED */ + nsCOMPtr<nsIDOMPopupBlockedEvent> popupEvent = do_QueryInterface (aDOMEvent); NS_ENSURE_TRUE (popupEvent, NS_ERROR_FAILURE); |