1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsContentPermissionHelper_h
6 #define nsContentPermissionHelper_h
8 #include "base/basictypes.h"
10 #include "nsIContentPermissionPrompt.h"
12 #include "nsIDOMElement.h"
14 #include "mozilla/dom/PermissionMessageUtils.h"
15 #include "mozilla/dom/PContentPermissionRequestParent.h"
17 class nsContentPermissionRequestProxy
;
22 class ContentPermissionRequestParent
: public PContentPermissionRequestParent
25 ContentPermissionRequestParent(const nsACString
& type
, const nsACString
& access
, nsIDOMElement
*element
, const IPC::Principal
& principal
);
26 virtual ~ContentPermissionRequestParent();
28 nsCOMPtr
<nsIPrincipal
> mPrincipal
;
29 nsCOMPtr
<nsIDOMElement
> mElement
;
30 nsCOMPtr
<nsContentPermissionRequestProxy
> mProxy
;
35 virtual bool Recvprompt();
36 virtual void ActorDestroy(ActorDestroyReason why
);
40 } // namespace mozilla
42 class nsContentPermissionRequestProxy
: public nsIContentPermissionRequest
45 nsContentPermissionRequestProxy();
46 virtual ~nsContentPermissionRequestProxy();
48 nsresult
Init(const nsACString
& type
, const nsACString
& access
, mozilla::dom::ContentPermissionRequestParent
* parent
);
49 void OnParentDestroyed();
52 NS_DECL_NSICONTENTPERMISSIONREQUEST
55 // Non-owning pointer to the ContentPermissionRequestParent object which owns this proxy.
56 mozilla::dom::ContentPermissionRequestParent
* mParent
;
60 #endif // nsContentPermissionHelper_h