mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00

This patch brings over the WebContent process over from SerenityOS to Ladybird, along with a new WebContentView widget that renders web content in a separate process. There's a lot of jank and FIXME material here, notably I had to re-add manually pumped Core::EventLoop instances on both sides, in order to get the IPC protocol running. This introduces a lot of latency and we should work towards replacing those loops with improved abstractions. The WebContent process is built separately here (not part of Lagom) and we provide our own main.cpp for it. Like everything, this can be better architected, it's just a starting point. :^)
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "Tab.h"
|
|
#include <AK/NonnullOwnPtrVector.h>
|
|
#include <LibCore/Forward.h>
|
|
#include <QIcon>
|
|
#include <QLineEdit>
|
|
#include <QMainWindow>
|
|
#include <QMenuBar>
|
|
#include <QTabWidget>
|
|
#include <QToolBar>
|
|
|
|
#pragma once
|
|
|
|
class WebContentView;
|
|
|
|
class BrowserWindow : public QMainWindow {
|
|
Q_OBJECT
|
|
public:
|
|
explicit BrowserWindow();
|
|
|
|
WebContentView& view() const { return m_current_tab->view(); }
|
|
|
|
int tab_index(Tab*);
|
|
|
|
public slots:
|
|
void tab_title_changed(int index, QString const&);
|
|
void tab_favicon_changed(int index, QIcon icon);
|
|
void new_tab();
|
|
void close_tab(int index);
|
|
void close_current_tab();
|
|
void open_next_tab();
|
|
void open_previous_tab();
|
|
void enable_auto_color_scheme();
|
|
void enable_light_color_scheme();
|
|
void enable_dark_color_scheme();
|
|
|
|
private:
|
|
void debug_request(String const& request, String const& argument = "");
|
|
|
|
QTabWidget* m_tabs_container { nullptr };
|
|
NonnullOwnPtrVector<Tab> m_tabs;
|
|
Tab* m_current_tab { nullptr };
|
|
};
|