/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Converts blindly, that is, strings are not matched against any list. // // @param aSrcArray needs to contain elements of type // `nsIContentPermissionType`. staticvoid ConvertArrayToPermissionRequest(
nsIArray* aSrcArray, nsTArray<PermissionRequest>& aDesArray);
class ContentPermissionRequestBase : public nsIContentPermissionRequest { public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(ContentPermissionRequestBase)
NS_IMETHOD GetTypes(nsIArray** aTypes) override;
NS_IMETHOD GetPrincipal(nsIPrincipal** aPrincipal) override;
NS_IMETHOD GetDelegatePrincipal(const nsACString& aType,
nsIPrincipal** aPrincipal) override;
NS_IMETHOD GetTopLevelPrincipal(nsIPrincipal** aTopLevelPrincipal) override;
NS_IMETHOD GetWindow(mozIDOMWindow** aWindow) override;
NS_IMETHOD GetElement(mozilla::dom::Element** aElement) override;
NS_IMETHOD GetHasValidTransientUserGestureActivation( bool* aHasValidTransientUserGestureActivation) override;
NS_IMETHOD GetIsRequestDelegatedToUnsafeThirdParty( bool* aIsRequestDelegatedToUnsafeThirdParty) override; // Overrides for Allow() and Cancel() aren't provided by this class. // That is the responsibility of the subclasses.
// The prefix of a pref which allows tests to bypass showing the prompt. // Tests will have to set both of // ${mPrefName}.prompt.testing and // ${mPrefName}.prompt.testing.allow // to either true or false. If no such testing is required, mPrefName may be // empty. const nsCString mPrefName;
// The type of the request, such as "autoplay-media-audible". const nsCString mType;
bool mHasValidTransientUserGestureActivation;
// See nsIPermissionDelegateHandler.maybeUnsafePermissionDelegate`. bool mIsRequestDelegatedToUnsafeThirdParty;
};
} // namespace mozilla::dom
using mozilla::dom::ContentPermissionRequestParent;
class nsContentPermissionRequestProxy : public nsIContentPermissionRequest { public:
NS_DECL_ISUPPORTS
NS_DECL_NSICONTENTPERMISSIONREQUEST
// Non-owning pointer to the ContentPermissionRequestParent object which owns // this proxy.
ContentPermissionRequestParent* mParent;
nsTArray<mozilla::dom::PermissionRequest> mPermissionRequests;
};
// It will be called when prompt dismissed. MOZ_CAN_RUN_SCRIPT_BOUNDARY // because we don't have MOZ_CAN_RUN_SCRIPT bits in IPC code yet.
MOZ_CAN_RUN_SCRIPT_BOUNDARY
mozilla::ipc::IPCResult RecvNotifyResult( constbool& aAllow, nsTArray<PermissionChoice>&& aChoices);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.