2025-03-24 09:27:36 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
|
|
#include <LibWeb/Bindings/WebUIPrototype.h>
|
|
|
|
#include <LibWeb/Internals/WebUI.h>
|
|
|
|
#include <LibWeb/Page/Page.h>
|
|
|
|
|
|
|
|
namespace Web::Internals {
|
|
|
|
|
|
|
|
GC_DEFINE_ALLOCATOR(WebUI);
|
|
|
|
|
|
|
|
WebUI::WebUI(JS::Realm& realm)
|
|
|
|
: InternalsBase(realm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
WebUI::~WebUI() = default;
|
|
|
|
|
|
|
|
void WebUI::initialize(JS::Realm& realm)
|
|
|
|
{
|
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(WebUI);
|
2025-04-20 16:22:57 +02:00
|
|
|
Base::initialize(realm);
|
2025-03-24 09:27:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void WebUI::send_message(String const& name, JS::Value data)
|
|
|
|
{
|
|
|
|
page().client().received_message_from_web_ui(name, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|