diff options
-rw-r--r-- | Ladybird/WebContentView.cpp | 12 | ||||
-rw-r--r-- | Ladybird/WebContentView.h | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWebView/OutOfProcessWebView.cpp | 18 | ||||
-rw-r--r-- | Userland/Libraries/LibWebView/OutOfProcessWebView.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWebView/ViewImplementation.cpp | 17 | ||||
-rw-r--r-- | Userland/Libraries/LibWebView/ViewImplementation.h | 8 |
6 files changed, 25 insertions, 43 deletions
diff --git a/Ladybird/WebContentView.cpp b/Ladybird/WebContentView.cpp index f7ee8f9894..b084c82515 100644 --- a/Ladybird/WebContentView.cpp +++ b/Ladybird/WebContentView.cpp @@ -82,18 +82,6 @@ WebContentView::~WebContentView() close_sub_widgets(); } -void WebContentView::load(AK::URL const& url) -{ - m_url = url; - client().async_load_url(url); -} - -void WebContentView::load_html(StringView html, AK::URL const& url) -{ - m_url = url; - client().async_load_html(html, url); -} - unsigned get_button_from_qt_event(QMouseEvent const& event) { if (event.button() == Qt::MouseButton::LeftButton) diff --git a/Ladybird/WebContentView.h b/Ladybird/WebContentView.h index c01b003ec4..4c6ebc43e4 100644 --- a/Ladybird/WebContentView.h +++ b/Ladybird/WebContentView.h @@ -49,9 +49,6 @@ public: explicit WebContentView(StringView webdriver_content_ipc_path); virtual ~WebContentView() override; - void load(AK::URL const&); - void load_html(StringView html, AK::URL const&); - Function<void(Gfx::IntPoint screen_position)> on_context_menu_request; Function<void(const AK::URL&, DeprecatedString const& target, unsigned modifiers)> on_link_click; Function<void(const AK::URL&, Gfx::IntPoint screen_position)> on_link_context_menu_request; @@ -204,8 +201,6 @@ private: void handle_web_content_process_crash(); - AK::URL m_url; - RefPtr<Gfx::Bitmap> m_backup_bitmap; StringView m_webdriver_content_ipc_path; diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index 6100294360..70cadabefc 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -74,24 +74,6 @@ void OutOfProcessWebView::create_client() client().async_update_screen_rects(GUI::Desktop::the().rects(), GUI::Desktop::the().main_screen_index()); } -void OutOfProcessWebView::load(const AK::URL& url) -{ - m_url = url; - client().async_load_url(url); -} - -void OutOfProcessWebView::load_html(StringView html, const AK::URL& url) -{ - m_url = url; - client().async_load_html(html, url); -} - -void OutOfProcessWebView::load_empty_document() -{ - m_url = {}; - client().async_load_html("", {}); -} - void OutOfProcessWebView::paint_event(GUI::PaintEvent& event) { Super::paint_event(event); diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h index c3e694674f..da68fde498 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h @@ -33,12 +33,6 @@ class OutOfProcessWebView final public: virtual ~OutOfProcessWebView() override; - AK::URL url() const { return m_url; } - void load(const AK::URL&); - - void load_html(StringView, const AK::URL&); - void load_empty_document(); - void debug_request(DeprecatedString const& request, DeprecatedString const& argument = {}); void js_console_input(DeprecatedString const& js_source); @@ -193,8 +187,6 @@ private: void enqueue_input_event(InputEvent const&); void process_next_input_event(); - AK::URL m_url; - RefPtr<Gfx::Bitmap> m_backup_bitmap; RefPtr<GUI::Dialog> m_dialog; diff --git a/Userland/Libraries/LibWebView/ViewImplementation.cpp b/Userland/Libraries/LibWebView/ViewImplementation.cpp index 0d6ba6bc90..ab3a172982 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.cpp +++ b/Userland/Libraries/LibWebView/ViewImplementation.cpp @@ -22,6 +22,23 @@ WebContentClient const& ViewImplementation::client() const return *m_client_state.client; } +void ViewImplementation::load(AK::URL const& url) +{ + m_url = url; + client().async_load_url(url); +} + +void ViewImplementation::load_html(StringView html, AK::URL const& url) +{ + m_url = url; + client().async_load_html(html, url); +} + +void ViewImplementation::load_empty_document() +{ + load_html(""sv, {}); +} + void ViewImplementation::zoom_in() { if (m_zoom_level >= ZOOM_MAX_LEVEL) diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index 056f5154b3..b3c27af8a4 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -28,6 +28,12 @@ public: String node_box_sizing_json; }; + AK::URL const& url() const { return m_url; } + + void load(AK::URL const&); + void load_html(StringView, AK::URL const&); + void load_empty_document(); + void zoom_in(); void zoom_out(); void reset_zoom(); @@ -116,6 +122,8 @@ protected: bool got_repaint_requests_while_painting { false }; } m_client_state; + AK::URL m_url; + float m_zoom_level { 1.0 }; float m_device_pixel_ratio { 1.0 }; }; |