mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
bf59e06d2a
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.
37 lines
835 B
C++
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;
|
|
};
|
|
|
|
}
|