Source code
Revision control
Copy as Markdown
Other Tools
/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
* 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
#include "IOSBridge.h"
#import "mozilla/widget/GeckoViewSupport.h"
#include "mozilla/widget/EventDispatcher.h"
using namespace mozilla::widget;
/* Implementation file */
NS_IMPL_ISUPPORTS(nsIOSBridge, nsIGeckoViewEventDispatcher, nsIGeckoViewBridge)
nsIOSBridge::nsIOSBridge() {
RefPtr<mozilla::widget::EventDispatcher> dispatcher =
new mozilla::widget::EventDispatcher();
dispatcher->Attach([GetSwiftRuntime() runtimeDispatcher]);
mEventDispatcher = dispatcher;
}
NS_IMETHODIMP
nsIOSBridge::GetDispatcherByName(const char* aName,
nsIGeckoViewEventDispatcher** aResult) {
RefPtr<mozilla::widget::EventDispatcher> dispatcher =
new mozilla::widget::EventDispatcher();
dispatcher->Attach([GetSwiftRuntime() dispatcherByName:aName]);
dispatcher.forget(aResult);
return NS_OK;
}
nsIOSBridge::~nsIOSBridge() = default;