1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

Help: Follow clicked links

This also adds a toolbar and a menu which allow you to
navigate back and forth through history ^)
This commit is contained in:
Sergey Bugaev 2019-10-02 22:44:05 +03:00 committed by Andreas Kling
parent afdc5688ec
commit 395e4210ef
4 changed files with 145 additions and 7 deletions

View file

@ -0,0 +1,22 @@
#pragma once
#include <AK/String.h>
#include <AK/Vector.h>
class History final {
public:
void push(const StringView& history_item);
String current();
void go_back();
void go_forward();
bool can_go_back() { return m_current_history_item > 0; }
bool can_go_forward() { return m_current_history_item + 1 < m_items.size(); }
void clear();
private:
Vector<String> m_items;
int m_current_history_item { -1 };
};