1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_MIDIPermissionRequest_h
8 #define mozilla_dom_MIDIPermissionRequest_h
10 #include "mozilla/dom/Promise.h"
18 * Handles permission dialog management when requesting MIDI permissions.
20 class MIDIPermissionRequest final
: public ContentPermissionRequestBase
,
23 MIDIPermissionRequest(nsPIDOMWindowInner
* aWindow
, Promise
* aPromise
,
24 const MIDIOptions
& aOptions
);
26 NS_DECL_ISUPPORTS_INHERITED
28 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MIDIPermissionRequest
,
29 ContentPermissionRequestBase
)
30 // nsIContentPermissionRequest
31 NS_IMETHOD
Cancel(void) override
;
32 NS_IMETHOD
Allow(JS::HandleValue choices
) override
;
33 NS_IMETHOD
GetTypes(nsIArray
** aTypes
) override
;
36 ~MIDIPermissionRequest() = default;
38 // Promise for returning MIDIAccess on request success
39 RefPtr
<Promise
> mPromise
;
40 // True if sysex permissions should be requested
45 } // namespace mozilla
47 #endif // mozilla_dom_MIDIPermissionRequest_h