mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:57:35 +00:00
Browser+LibWeb: Pave the way for using WebContentView in Browser
This commit sets everything up, but we still always instantiate a plain Web::PageView in Browser::Tab..
This commit is contained in:
parent
49b9a0a665
commit
d8be535579
6 changed files with 177 additions and 73 deletions
|
@ -32,15 +32,29 @@
|
|||
#include <LibHTTP/HttpJob.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
class WebContentView;
|
||||
|
||||
namespace Web {
|
||||
class WebViewHooks;
|
||||
}
|
||||
|
||||
namespace Browser {
|
||||
|
||||
class Tab final : public GUI::Widget {
|
||||
C_OBJECT(Tab);
|
||||
|
||||
public:
|
||||
enum class Type {
|
||||
InProcessWebView,
|
||||
OutOfProcessWebView,
|
||||
};
|
||||
|
||||
virtual ~Tab() override;
|
||||
|
||||
URL url() const;
|
||||
|
||||
void load(const URL&);
|
||||
void reload();
|
||||
|
||||
void did_become_active();
|
||||
void context_menu_requested(const Gfx::IntPoint& screen_position);
|
||||
|
@ -53,14 +67,22 @@ public:
|
|||
const String& title() const { return m_title; }
|
||||
const Gfx::Bitmap* icon() const { return m_icon; }
|
||||
|
||||
private:
|
||||
Tab();
|
||||
GUI::Widget& view();
|
||||
|
||||
private:
|
||||
explicit Tab(Type);
|
||||
|
||||
Web::WebViewHooks& hooks();
|
||||
void update_actions();
|
||||
void update_bookmark_button(const String& url);
|
||||
|
||||
Type m_type;
|
||||
|
||||
History<URL> m_history;
|
||||
|
||||
RefPtr<Web::PageView> m_page_view;
|
||||
RefPtr<WebContentView> m_web_content_view;
|
||||
|
||||
RefPtr<GUI::Action> m_go_back_action;
|
||||
RefPtr<GUI::Action> m_go_forward_action;
|
||||
RefPtr<GUI::Action> m_reload_action;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue