ladybird/Userland/Applications/Browser/ConsoleWidget.h
Timothy Flynn bf59e06d2a Ladybird+LibWebView: Extract common JS console functionality to a helper
This creates WebView::ConsoleClient to handle functionality that will be
common to the JS consoles of all Ladybird chromes. This will let each
chrome focus on just the UI.

Note that this includes the `console.group` functionality that only the
Serenity chrome previously had. This was a FIXME in the Qt chrome, and
it is implemented such that all chromes will receive this functionality
for free.
2023-08-30 09:24:59 +02:00

37 lines
835 B
C++

/*
* Copyright (c) 2020, Hunter Salyer <thefalsehonesty@gmail.com>
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/OwnPtr.h>
#include <LibGUI/Widget.h>
#include <LibWebView/Forward.h>
namespace Browser {
class ConsoleWidget final : public GUI::Widget {
C_OBJECT(ConsoleWidget)
public:
virtual ~ConsoleWidget();
void reset();
private:
explicit ConsoleWidget(WebView::OutOfProcessWebView& content_view);
void request_console_messages();
void clear_output();
OwnPtr<WebView::ConsoleClient> m_console_client;
RefPtr<GUI::TextBox> m_input;
RefPtr<WebView::OutOfProcessWebView> m_output_view;
};
}