summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/Tab.cpp
diff options
context:
space:
mode:
authorRafał Babiarz <5783815+Sauler@users.noreply.github.com>2022-12-10 16:50:47 +0100
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-31 04:36:22 -0700
commit3454891d3877c41e3daf6ff4bf29c602643a897c (patch)
treecbef73fcb753bda20340a4af4c40ba6595b668db /Userland/Applications/Browser/Tab.cpp
parentebe925b7c0dd72c4ed8955fa9e7f7adf84c0a84f (diff)
downloadserenity-3454891d3877c41e3daf6ff4bf29c602643a897c.zip
Browser: Add window to inspect history
Diffstat (limited to 'Userland/Applications/Browser/Tab.cpp')
-rw-r--r--Userland/Applications/Browser/Tab.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp
index d6f32ed3f6..477162a62f 100644
--- a/Userland/Applications/Browser/Tab.cpp
+++ b/Userland/Applications/Browser/Tab.cpp
@@ -14,6 +14,7 @@
#include "BrowserWindow.h"
#include "ConsoleWidget.h"
#include "DownloadWidget.h"
+#include "History/HistoryWidget.h"
#include "InspectorWidget.h"
#include "StorageWidget.h"
#include <AK/StringBuilder.h>
@@ -752,6 +753,24 @@ void Tab::show_storage_inspector()
window->move_to_front();
}
+void Tab::show_history_inspector()
+{
+ if (!m_history_widget) {
+ auto history_window = GUI::Window::construct(&window());
+ history_window->resize(500, 300);
+ history_window->set_title("History");
+ history_window->set_icon(g_icon_bag.history);
+ m_history_widget = history_window->set_main_widget<HistoryWidget>();
+ }
+
+ m_history_widget->clear_history_entries();
+ m_history_widget->set_history_entries(m_history.get_all_history_entries());
+
+ auto* window = m_history_widget->window();
+ window->show();
+ window->move_to_front();
+}
+
void Tab::show_event(GUI::ShowEvent&)
{
m_web_content_view->set_visible(true);