summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/BrowserConsoleClient.h
blob: 06208cfb91108217abfaad3c14e921ad8ed03ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright (c) 2020, Hunter Salyer <thefalsehonesty@gmail.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibGUI/Widget.h>
#include <LibJS/Console.h>
#include <LibJS/Forward.h>
#include <LibWeb/InProcessWebView.h>

namespace Browser {

class ConsoleWidget;

class BrowserConsoleClient final : public JS::ConsoleClient {
public:
    BrowserConsoleClient(JS::Console& console, ConsoleWidget& console_widget)
        : ConsoleClient(console)
        , m_console_widget(console_widget)
    {
    }

private:
    virtual JS::Value log() override;
    virtual JS::Value info() override;
    virtual JS::Value debug() override;
    virtual JS::Value warn() override;
    virtual JS::Value error() override;
    virtual JS::Value clear() override;
    virtual JS::Value trace() override;
    virtual JS::Value count() override;
    virtual JS::Value count_reset() override;
    virtual JS::Value assert_() override;

    ConsoleWidget& m_console_widget;
};

}