LibWebView+Services+UI: Move the Web plugins to LibWebView

This commit is contained in:
Timothy Flynn 2024-11-10 09:53:15 -05:00 committed by Tim Flynn
parent 9e1f001ffe
commit a14937c45e
Notes: github-actions[bot] 2024-11-11 12:36:47 +00:00
9 changed files with 22 additions and 34 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2022, Dex <dexes.ttp@gmail.com>
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibImageDecoderClient/Client.h>
#include <LibWeb/Platform/ImageCodecPlugin.h>
namespace WebView {
class ImageCodecPlugin final : public Web::Platform::ImageCodecPlugin {
public:
explicit ImageCodecPlugin(NonnullRefPtr<ImageDecoderClient::Client>);
virtual ~ImageCodecPlugin() override;
virtual NonnullRefPtr<Core::Promise<Web::Platform::DecodedImage>> decode_image(ReadonlyBytes, Function<ErrorOr<void>(Web::Platform::DecodedImage&)> on_resolved, Function<void(Error&)> on_rejected) override;
void set_client(NonnullRefPtr<ImageDecoderClient::Client>);
private:
RefPtr<ImageDecoderClient::Client> m_client;
};
}