LibWebView+UI: Generate action to enable/disable DevTools

This commit is contained in:
Timothy Flynn 2025-09-17 10:03:01 -04:00 committed by Tim Flynn
commit 14d49d5a3a
Notes: github-actions[bot] 2025-09-18 11:28:44 +00:00
13 changed files with 121 additions and 112 deletions

View file

@ -83,6 +83,7 @@ public:
Action& open_about_page_action() { return *m_open_about_page_action; }
Action& open_processes_page_action() { return *m_open_processes_page_action; }
Action& open_settings_page_action() { return *m_open_settings_page_action; }
Action& toggle_devtools_action() { return *m_toggle_devtools_action; }
Action& view_source_action() { return *m_view_source_action; }
Menu& zoom_menu() { return *m_zoom_menu; }
@ -95,11 +96,7 @@ public:
void apply_view_options(Badge<ViewImplementation>, ViewImplementation&);
enum class DevtoolsState {
Disabled,
Enabled,
};
ErrorOr<DevtoolsState> toggle_devtools_enabled();
ErrorOr<void> toggle_devtools_enabled();
void refresh_tab_list();
protected:
@ -115,6 +112,9 @@ protected:
virtual Optional<ByteString> ask_user_for_download_folder() const { return {}; }
virtual void on_devtools_enabled() const;
virtual void on_devtools_disabled() const;
Main::Arguments& arguments() { return m_arguments; }
private:
@ -189,6 +189,7 @@ private:
RefPtr<Action> m_open_about_page_action;
RefPtr<Action> m_open_processes_page_action;
RefPtr<Action> m_open_settings_page_action;
RefPtr<Action> m_toggle_devtools_action;
RefPtr<Action> m_view_source_action;
RefPtr<Menu> m_zoom_menu;