mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
Browser: Add storage inspector
This commit is contained in:
parent
5f5ee2020e
commit
c2e2a964f2
Notes:
sideshowbarker
2024-07-17 18:02:41 +09:00
Author: https://github.com/Sauler
Commit: c2e2a964f2
Pull-request: https://github.com/SerenityOS/serenity/pull/12832
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/trflynn89
10 changed files with 431 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
|||
#include "ConsoleWidget.h"
|
||||
#include "DownloadWidget.h"
|
||||
#include "InspectorWidget.h"
|
||||
#include "StorageWidget.h"
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/URL.h>
|
||||
#include <Applications/Browser/TabGML.h>
|
||||
|
@ -533,4 +534,26 @@ void Tab::show_console_window()
|
|||
window->move_to_front();
|
||||
}
|
||||
|
||||
void Tab::show_storage_inspector()
|
||||
{
|
||||
if (!m_storage_widget) {
|
||||
auto storage_window = GUI::Window::construct(&window());
|
||||
storage_window->resize(500, 300);
|
||||
storage_window->set_title("Storage inspector");
|
||||
storage_window->set_icon(g_icon_bag.cookie);
|
||||
m_storage_widget = storage_window->set_main_widget<StorageWidget>();
|
||||
}
|
||||
|
||||
if (on_want_cookies) {
|
||||
auto cookies = on_want_cookies();
|
||||
m_storage_widget->clear_cookies();
|
||||
for (auto cookie : cookies)
|
||||
m_storage_widget->add_cookie(cookie);
|
||||
}
|
||||
|
||||
auto* window = m_storage_widget->window();
|
||||
window->show();
|
||||
window->move_to_front();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue