Skip to content

Truly independent web browser

896 B
Raw Blame
/*
 * Copyright (c) 2025-present, the Ladybird developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibGC/CellAllocator.h>
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/Forward.h>

namespace Web::HTML {

// https://html.spec.whatwg.org/multipage/nav-history-apis.html#barprop
class BarProp : public Bindings::GCAllocatedWrappable {
    WEB_WRAPPABLE(BarProp, Bindings::GCAllocatedWrappable);
    GC_DECLARE_ALLOCATOR(BarProp);

public:
    BarProp(Window&);
    static GC::Ref<BarProp> create(Window&);

    [[nodiscard]] Window& window() { return m_window; }
    [[nodiscard]] Window const& window() const { return m_window; }
    [[nodiscard]] bool visible() const;

private:
    virtual void visit_edges(GC::Cell::Visitor&) override;
    virtual GC::Ptr<Bindings::Wrappable> relevant_global_impl() const override;

    GC::Ref<Window> m_window;
};

}