mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
Ladybird: Move ownership of the JS console/inspector to the tab object
This is to match Browser, where ownership of all "subwidgets" is placed on the tab as well. This further lets us align the web view callbacks to match Browser's OOPWV as well, which will later let us move them into the base LibWebView class.
This commit is contained in:
parent
2d51b8c286
commit
c113d780c6
9 changed files with 147 additions and 134 deletions
|
@ -26,11 +26,6 @@
|
|||
class QTextEdit;
|
||||
class QLineEdit;
|
||||
|
||||
namespace Ladybird {
|
||||
class ConsoleWidget;
|
||||
class InspectorWidget;
|
||||
}
|
||||
|
||||
namespace WebView {
|
||||
class WebContentClient;
|
||||
}
|
||||
|
@ -66,6 +61,7 @@ public:
|
|||
Function<void(const AK::URL&, DeprecatedString const&)> on_get_source;
|
||||
Function<void(DeprecatedString const&)> on_get_dom_tree;
|
||||
Function<void(i32 node_id, DeprecatedString const& specified_style, DeprecatedString const& computed_style, DeprecatedString const& custom_properties, DeprecatedString const& node_box_sizing)> on_get_dom_node_properties;
|
||||
Function<void(DeprecatedString const&)> on_get_accessibility_tree;
|
||||
Function<void(i32 message_id)> on_js_console_new_message;
|
||||
Function<void(i32 start_index, Vector<DeprecatedString> const& message_types, Vector<DeprecatedString> const& messages)> on_get_js_console_messages;
|
||||
Function<Vector<Web::Cookie::Cookie>(AK::URL const& url)> on_get_all_cookies;
|
||||
|
@ -91,16 +87,6 @@ public:
|
|||
virtual void focusOutEvent(QFocusEvent*) override;
|
||||
virtual bool event(QEvent*) override;
|
||||
|
||||
void show_js_console();
|
||||
|
||||
enum class InspectorTarget {
|
||||
Document,
|
||||
HoveredElement
|
||||
};
|
||||
void show_inspector(InspectorTarget = InspectorTarget::Document);
|
||||
|
||||
Ladybird::ConsoleWidget* console() { return m_console_widget; };
|
||||
|
||||
ErrorOr<String> dump_layout_tree();
|
||||
|
||||
void set_viewport_rect(Gfx::IntRect);
|
||||
|
@ -200,20 +186,11 @@ private:
|
|||
|
||||
void update_viewport_rect();
|
||||
|
||||
void ensure_js_console_widget();
|
||||
void ensure_inspector_widget();
|
||||
|
||||
bool is_inspector_open() const;
|
||||
void close_sub_widgets();
|
||||
|
||||
qreal m_inverse_pixel_scaling_ratio { 1.0 };
|
||||
bool m_should_show_line_box_borders { false };
|
||||
|
||||
QPointer<QDialog> m_dialog;
|
||||
|
||||
Ladybird::ConsoleWidget* m_console_widget { nullptr };
|
||||
Ladybird::InspectorWidget* m_inspector_widget { nullptr };
|
||||
|
||||
Gfx::IntRect m_viewport_rect;
|
||||
|
||||
StringView m_webdriver_content_ipc_path;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue