diff options
author | stoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 14:56:38 +0000 |
---|---|---|
committer | stoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 14:56:38 +0000 |
commit | f9cc4c4597f2455409008a76d88ed11dbe05796a (patch) | |
tree | 3d1df599805bde20ebfc063c9da87637bb240e08 /chrome_frame | |
parent | 2884a003274a81a3d67a0af97070c427e5ff8956 (diff) | |
download | chromium_src-f9cc4c4597f2455409008a76d88ed11dbe05796a.zip chromium_src-f9cc4c4597f2455409008a76d88ed11dbe05796a.tar.gz chromium_src-f9cc4c4597f2455409008a76d88ed11dbe05796a.tar.bz2 |
This CL is for the needs of ChromeFrame.
TabContentsDelegate implementation may override navigations caused by JsvaScript history object.
Yet not perfect since webkit view of navigation stack differs from the view of external-non-Chrome-host-browser.
We have to provide the full stack from host-browser (+visited links alongside) in the same way as Chrome-browser provides it to renderer.
BUG=24004
Review URL: http://codereview.chromium.org/261046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 13 | ||||
-rw-r--r-- | chrome_frame/chrome_active_document.h | 1 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_delegate.cc | 3 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_delegate.h | 1 |
4 files changed, 18 insertions, 0 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 2e3c43f..1f7515d 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -790,3 +790,16 @@ HRESULT ChromeActiveDocument::SetPageFontSize(const GUID* cmd_group_guid, return S_OK; } +void ChromeActiveDocument::OnGoToHistoryEntryOffset(int tab_handle, + int offset) { + DLOG(INFO) << "GoToHistoryEntryOffset " << offset; + ScopedComPtr<IBrowserService> browser_service; + DoQueryService(SID_SShellBrowser, m_spClientSite, browser_service.Receive()); + if (browser_service) { + ScopedComPtr<ITravelLog> travel_log; + browser_service->GetTravelLog(travel_log.Receive()); + if (travel_log) { + travel_log->Travel(browser_service, offset); + } + } +} diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index ee2c850..072bc00 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -218,6 +218,7 @@ END_EXEC_COMMAND_MAP() int open_disposition); virtual void OnLoad(int tab_handle, const GURL& url); + virtual void OnGoToHistoryEntryOffset(int tab_handle, int offset); // A helper method that updates our internal navigation state // as well as IE's navigation state (viz Title and current URL). diff --git a/chrome_frame/chrome_frame_delegate.cc b/chrome_frame/chrome_frame_delegate.cc index 9a1069b..396d7a9 100644 --- a/chrome_frame/chrome_frame_delegate.cc +++ b/chrome_frame/chrome_frame_delegate.cc @@ -24,6 +24,7 @@ bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message, IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, ) IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, ) IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, ) + IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestGoToHistoryEntryOffset, ) IPC_MESSAGE_UNHANDLED(is_tab_message = false); IPC_END_MESSAGE_MAP() @@ -63,5 +64,7 @@ void ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(AutomationMsg_RequestEnd, OnRequestEnd) IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync) IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab) + IPC_MESSAGE_HANDLER(AutomationMsg_RequestGoToHistoryEntryOffset, + OnGoToHistoryEntryOffset) IPC_END_MESSAGE_MAP() } diff --git a/chrome_frame/chrome_frame_delegate.h b/chrome_frame/chrome_frame_delegate.h index ebde626..2c8acd9 100644 --- a/chrome_frame/chrome_frame_delegate.h +++ b/chrome_frame/chrome_frame_delegate.h @@ -91,6 +91,7 @@ class ChromeFrameDelegateImpl : public ChromeFrameDelegate { const std::string& cookie) {} virtual void OnAttachExternalTab(int tab_handle, intptr_t cookie, int disposition) {} + virtual void OnGoToHistoryEntryOffset(int tab_handle, int offset) {} }; #endif // CHROME_FRAME_CHROME_FRAME_DELEGATE_H_ |