diff options
Diffstat (limited to 'webkit/tools/test_shell/test_navigation_controller.cc')
-rw-r--r-- | webkit/tools/test_shell/test_navigation_controller.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/test_navigation_controller.cc b/webkit/tools/test_shell/test_navigation_controller.cc index cf26baf..ff4a753 100644 --- a/webkit/tools/test_shell/test_navigation_controller.cc +++ b/webkit/tools/test_shell/test_navigation_controller.cc @@ -5,6 +5,7 @@ #include "webkit/tools/test_shell/test_navigation_controller.h" #include "base/logging.h" +#include "webkit/glue/webhistoryitem.h" #include "webkit/tools/test_shell/test_shell.h" // ---------------------------------------------------------------------------- @@ -28,9 +29,21 @@ TestNavigationEntry::~TestNavigationEntry() { } void TestNavigationEntry::SetContentState(const std::string& state) { + cached_history_item_ = NULL; // invalidate our cached item state_ = state; } +WebHistoryItem* TestNavigationEntry::GetHistoryItem() const { + if (!cached_history_item_) { + TestShellExtraRequestData* extra_data = + new TestShellExtraRequestData(GetPageID()); + cached_history_item_ = + WebHistoryItem::Create(GetURL(), GetTitle(), GetContentState(), + extra_data); + } + return cached_history_item_; +} + // ---------------------------------------------------------------------------- // TestNavigationController |