mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1022193 - Add a "forceIdSelection" to navigator.getMobileIdAssertion. Part 2: DOM. r=sicking
This commit is contained in:
parent
a6dcf570c5
commit
bbb3d1581c
@ -1591,7 +1591,8 @@ Navigator::GetMozTelephony(ErrorResult& aRv)
|
||||
|
||||
#ifdef MOZ_B2G
|
||||
already_AddRefed<Promise>
|
||||
Navigator::GetMobileIdAssertion(ErrorResult& aRv)
|
||||
Navigator::GetMobileIdAssertion(const MobileIdOptions& aOptions,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (!mWindow || !mWindow->GetDocShell()) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
@ -1605,8 +1606,22 @@ Navigator::GetMobileIdAssertion(ErrorResult& aRv)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||
if (!cx) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JS::Rooted<JS::Value> optionsValue(cx);
|
||||
if (!ToJSValue(cx, aOptions, &optionsValue)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> promise;
|
||||
aRv = service->GetMobileIdAssertion(mWindow, getter_AddRefs(promise));
|
||||
aRv = service->GetMobileIdAssertion(mWindow,
|
||||
optionsValue,
|
||||
getter_AddRefs(promise));
|
||||
|
||||
nsRefPtr<Promise> p = static_cast<Promise*>(promise.get());
|
||||
return p.forget();
|
||||
|
@ -35,6 +35,7 @@ class systemMessageCallback;
|
||||
struct MediaStreamConstraints;
|
||||
class WakeLock;
|
||||
class ArrayBufferViewOrBlobOrStringOrFormData;
|
||||
struct MobileIdOptions;
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,14 +215,15 @@ public:
|
||||
ErrorResult& aRv);
|
||||
bool MozHasPendingMessage(const nsAString& aType, ErrorResult& aRv);
|
||||
#ifdef MOZ_B2G
|
||||
already_AddRefed<Promise> GetMobileIdAssertion(ErrorResult& aRv);
|
||||
already_AddRefed<Promise> GetMobileIdAssertion(const MobileIdOptions& options,
|
||||
ErrorResult& aRv);
|
||||
#endif
|
||||
#ifdef MOZ_B2G_RIL
|
||||
MobileConnectionArray* GetMozMobileConnections(ErrorResult& aRv);
|
||||
CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv);
|
||||
Voicemail* GetMozVoicemail(ErrorResult& aRv);
|
||||
IccManager* GetMozIccManager(ErrorResult& aRv);
|
||||
#endif // MOZ_B2G_RILi
|
||||
#endif // MOZ_B2G_RIL
|
||||
#ifdef MOZ_GAMEPAD
|
||||
void GetGamepads(nsTArray<nsRefPtr<Gamepad> >& aGamepads, ErrorResult& aRv);
|
||||
#endif // MOZ_GAMEPAD
|
||||
|
@ -6,8 +6,9 @@
|
||||
|
||||
interface nsIDOMWindow;
|
||||
|
||||
[scriptable, uuid(376d3a43-a7f2-4ac0-b196-d83acb3a68cc)]
|
||||
[scriptable, uuid(2dff5d37-d39d-4a7b-9bad-c108712c8a91)]
|
||||
interface nsIMobileIdentityService : nsISupports
|
||||
{
|
||||
nsISupports getMobileIdAssertion(in nsIDOMWindow window);
|
||||
nsISupports getMobileIdAssertion(in nsIDOMWindow window,
|
||||
in jsval options);
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ MobileIdentityService.prototype = {
|
||||
// TODO: this should be handled by DOMRequestIpcHelper. Bug 1020582
|
||||
_windows: {},
|
||||
|
||||
getMobileIdAssertion: function(aWindow) {
|
||||
getMobileIdAssertion: function(aWindow, aOptions) {
|
||||
log.debug("getMobileIdAssertion");
|
||||
|
||||
if (!this.init) {
|
||||
@ -49,7 +49,8 @@ MobileIdentityService.prototype = {
|
||||
this._windows[promiseId] = aWindow;
|
||||
|
||||
cpmm.sendAsyncMessage("MobileId:GetAssertion", {
|
||||
promiseId: promiseId
|
||||
promiseId: promiseId,
|
||||
options: aOptions
|
||||
}, null, aWindow.document.nodePrincipal);
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user