aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EventContext.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-05-09 01:59:07 +0800
committerChristian Persch <chpe@src.gnome.org>2005-05-09 01:59:07 +0800
commitdb6332110ee1fa475515cfee88c57d5d0aa9ce1d (patch)
treebce91587e8d1688c3982f854096af48f08c3637c /embed/mozilla/EventContext.cpp
parent79f63d46a39524f075af29e753cc23e5e699ecb8 (diff)
downloadgsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.tar
gsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.tar.gz
gsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.tar.bz2
gsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.tar.lz
gsoc2013-epiphany-db6332110ee1fa475515cfee88c57d5d0aa9ce1d.tar.xz
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/EventContext.cpp')
-rw-r--r--embed/mozilla/EventContext.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp
index d8bbf4fcb..1ac345b5b 100644
--- a/embed/mozilla/EventContext.cpp
+++ b/embed/mozilla/EventContext.cpp
@@ -667,6 +667,13 @@ nsresult EventContext::GetMouseEventInfo (nsIDOMMouseEvent *aMouseEvent, Mozilla
nsCOMPtr<nsIDOMNSEvent> nsEvent = do_QueryInterface(aMouseEvent);
if (!nsEvent) return NS_ERROR_FAILURE;
+#ifdef MOZ_NSIDOMNSEVENT_GETISTRUSTED
+ /* make sure the event is trusted */
+ PRBool isTrusted = PR_FALSE;
+ nsEvent->GetIsTrusted (&isTrusted);
+ if (!isTrusted) return NS_ERROR_UNEXPECTED;
+#endif /* MOZ_NSIDOMNSEVENT_GETISTRUSTED */
+
nsresult rv;
nsCOMPtr<nsIDOMEventTarget> OriginalTarget;
rv = nsEvent->GetOriginalTarget(getter_AddRefs(OriginalTarget));
@@ -718,6 +725,17 @@ nsresult EventContext::GetMouseEventInfo (nsIDOMMouseEvent *aMouseEvent, Mozilla
nsresult EventContext::GetKeyEventInfo (nsIDOMKeyEvent *aKeyEvent, MozillaEmbedEvent *info)
{
+#ifdef MOZ_NSIDOMNSEVENT_GETISTRUSTED
+ /* make sure the event is trusted */
+ nsCOMPtr<nsIDOMNSEvent> nsEvent (do_QueryInterface (aKeyEvent));
+ NS_ENSURE_TRUE (nsEvent, NS_ERROR_FAILURE);
+
+ PRBool isTrusted = PR_FALSE;
+ nsEvent->GetIsTrusted (&isTrusted);
+ if (!isTrusted) return NS_ERROR_UNEXPECTED;
+#endif /* MOZ_NSIDOMNSEVENT_GETISTRUSTED */
+
+
info->button = 0;
nsresult rv;