Skip to content
Snippets Groups Projects
Commit 514fc965 authored by Odilitime's avatar Odilitime
Browse files

print(), pointInHistory draft, notes

parent 51cdc564
No related branches found
No related tags found
No related merge requests found
......@@ -50,3 +50,11 @@ void BrowsingHistory::replaceState(void* stateObj, std::string const& title, URL
}
*currentPosition = (*currentPosition).merge(url);
}
void BrowsingHistory::print() {
int i = 0;
for(std::vector<URL>::iterator it=history.begin(); it!=history.end(); ++it) {
std::cout << "BrowsingHistory::print " << i << ": " << it->toString() << std::endl;
i++;
}
}
......@@ -5,6 +5,13 @@
#include "URL.h"
#include <functional>
struct pointInHistory {
URL realURL;
URL displayURL;
std::string title;
void* stateObj; // limit of 640k here
};
/*
NOTE: The first parameter of the constructor is the callback to be called when
calling go(int) (or back or forward or whatever). Should be a
......@@ -28,11 +35,16 @@ public:
// stateObj: void* should be a Javascript object once we have those. Just
// give it nullptr for the time being.
// title: "Firefox currently ignores this parameter, although it may
// use it in the future.". So i guess we ignore it too?
// use it in the future.". So i guess we ignore it too? well we'll make plans to properly use it.
void pushState(void* stateObj, std::string const& title, URL const& url);
void replaceState(void* stateObj, std::string const& title, URL const& url);
// onGotoPage can call onPopState... or maybe it should be renamed?
// onPopState <- call when fwd/bck are used and sends the state associated with that point in history
void print();
private:
// push overrides the real URL with a display URL, we'll need to store both
// also need to store a state
std::vector<URL> history;
std::vector<URL>::iterator currentPosition;
std::function<void(URL const&)> onGotoPage;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment