1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:54:58 +00:00
serenity/Userland/Applications/Browser/StorageWidget.h
Valtteri Koskivuori 45a81f5a2c Browser+LibWeb+WebContent: Add ability to inspect local storage
The storage inspector now has a new tab for local storage. The next step
would be to persist local storage and receive real-time notifications
for changes to update the table view.
2022-04-03 13:13:10 +01:00

40 lines
1,008 B
C++

/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "CookiesModel.h"
#include "LocalStorageModel.h"
#include "Tab.h"
#include <LibGUI/SortingProxyModel.h>
#include <LibGUI/Widget.h>
#include <LibWeb/Cookie/Cookie.h>
namespace Browser {
class StorageWidget final : public GUI::Widget {
C_OBJECT(StorageWidget);
public:
virtual ~StorageWidget() override = default;
void add_cookie(Web::Cookie::Cookie const& cookie);
void clear_cookies();
void set_local_storage_entries(OrderedHashMap<String, String> entries);
void clear_local_storage_entries();
private:
StorageWidget();
RefPtr<GUI::TableView> m_cookies_table_view;
RefPtr<CookiesModel> m_cookies_model;
RefPtr<GUI::SortingProxyModel> m_cookie_sorting_model;
RefPtr<GUI::TableView> m_local_storage_table_view;
RefPtr<LocalStorageModel> m_local_storage_model;
RefPtr<GUI::SortingProxyModel> m_local_storage_sorting_model;
};
}