/* * Copyright (c) 2021, Luke Wilde * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include namespace Web::HTML { class History final : public RefCounted , public Weakable , public Bindings::Wrappable { public: using WrapperType = Bindings::HistoryWrapper; static NonnullRefPtr create(DOM::Document& document) { return adopt_ref(*new History(document)); } virtual ~History() override; DOM::ExceptionOr push_state(JS::Value data, String const& unused, String const& url); DOM::ExceptionOr replace_state(JS::Value data, String const& unused, String const& url); private: explicit History(DOM::Document&); enum class IsPush { No, Yes, }; DOM::ExceptionOr shared_history_push_replace_state(JS::Value data, String const& url, IsPush is_push); DOM::Document& m_associated_document; }; }