diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 00:53:23 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 00:53:23 +0000 |
commit | a1800e8c451736dea5663ae461454ab663d05bc4 (patch) | |
tree | 87ff9157562b9616139bb6154a06902e5ede5287 /chrome_frame/chrome_active_document.h | |
parent | 4f03cbccc4c09db3f053b74393961e8728bceeec (diff) | |
download | chromium_src-a1800e8c451736dea5663ae461454ab663d05bc4.zip chromium_src-a1800e8c451736dea5663ae461454ab663d05bc4.tar.gz chromium_src-a1800e8c451736dea5663ae461454ab663d05bc4.tar.bz2 |
Back/Forward support for url fragments
Added support for anchor (url fragments). this involves
mainly implementing IPersistHistory. The rest of the stuff
is a song and dance to get called in IPersistHistory in the
first place and then behave correctly when we do.
BUG=23981
TEst=unit tests added and back forward with '#' URLs, sub frames etc.
Review URL: http://codereview.chromium.org/371004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_active_document.h')
-rw-r--r-- | chrome_frame/chrome_active_document.h | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index ee2cf6e..103eb49 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -10,6 +10,7 @@ #include <atlctl.h> #include <map> #include <mshtmcid.h> +#include <perhist.h> #include "base/scoped_ptr.h" #include "base/scoped_comptr_win.h" @@ -18,6 +19,8 @@ #include "chrome_frame/chrome_frame_activex_base.h" #include "chrome_frame/com_type_info_holder.h" #include "chrome_frame/find_dialog.h" +#include "chrome_frame/html_private_window_impl.h" +#include "chrome_frame/html_window_impl.h" #include "chrome_frame/in_place_menu.h" #include "chrome_frame/ole_document_impl.h" #include "chrome_frame/resource.h" @@ -54,6 +57,17 @@ class ChromeActiveDocument; #define SBCMDID_MIXEDZONE 39 #endif // SBCMDID_MIXEDZONE +// From MSDN: +// Controlling Navigation: The fact that a document can navigate on its own +// implies that it will also take care of updating the navigation history. +// In Internet Explorer 6 and later, the DocObject can indicate to the client +// site that it can navigate using CGID_DocHostCmdPriv (a privately defined +// command group GUID) and the DOCHOST_DOCCANNAVIGATE command. A pointer to +// the object that implements the IHTMLWindow2 interface is passed with the +// command in the VARIANTARG* parameter pvaIn. (Set pvaIn to NULL if the +// document cannot perform its own navigation.) +#define DOCHOST_DOCCANNAVIGATE (0) + // This macro should be defined in the public section of the class. #define BEGIN_EXEC_COMMAND_MAP(theClass) \ public: \ @@ -97,14 +111,17 @@ class ChromeActiveDocument; // Chrome.exe (via the Chrome IPC-based automation mechanism) for the actual // rendering class ATL_NO_VTABLE ChromeActiveDocument - : public ChromeFrameActivexBase<ChromeActiveDocument, - CLSID_ChromeActiveDocument>, - public IOleDocumentImpl<ChromeActiveDocument>, - public IOleDocumentViewImpl<ChromeActiveDocument>, - public IPersistMoniker, - public IOleCommandTarget, - public InPlaceMenu<ChromeActiveDocument>, - public IWebBrowserEventsUrlService { + : public ChromeFrameActivexBase<ChromeActiveDocument, + CLSID_ChromeActiveDocument>, + public IOleDocumentImpl<ChromeActiveDocument>, + public IOleDocumentViewImpl<ChromeActiveDocument>, + public IPersistMoniker, + public IOleCommandTarget, + public InPlaceMenu<ChromeActiveDocument>, + public IWebBrowserEventsUrlService, + public IPersistHistory, + public HTMLWindowImpl<IHTMLWindow2>, + public HTMLPrivateWindowImpl<IHTMLPrivateWindow> { public: typedef ChromeFrameActivexBase<ChromeActiveDocument, CLSID_ChromeActiveDocument> Base; @@ -119,6 +136,11 @@ BEGIN_COM_MAP(ChromeActiveDocument) COM_INTERFACE_ENTRY(IPersistMoniker) COM_INTERFACE_ENTRY(IOleCommandTarget) COM_INTERFACE_ENTRY(IWebBrowserEventsUrlService) + COM_INTERFACE_ENTRY(IPersist) + COM_INTERFACE_ENTRY(IPersistHistory) + COM_INTERFACE_ENTRY(IHTMLFramesCollection2) + COM_INTERFACE_ENTRY(IHTMLWindow2) + COM_INTERFACE_ENTRY(IHTMLPrivateWindow) COM_INTERFACE_ENTRY_CHAIN(Base) END_COM_MAP() @@ -195,9 +217,18 @@ END_EXEC_COMMAND_MAP() VARIANT* in_args, VARIANT* out_args); + // IPersistHistory + STDMETHOD(LoadHistory)(IStream* stream, IBindCtx* bind_context); + STDMETHOD(SaveHistory)(IStream* stream); + STDMETHOD(SetPositionCookie)(DWORD position_cookie); + STDMETHOD(GetPositionCookie)(DWORD* position_cookie); + // IWebBrowserEventsUrlService methods STDMETHOD(GetUrlForEvents)(BSTR* url); + // IHTMLPrivateWindow methods + STDMETHOD(GetAddressBarUrl)(BSTR* url); + // ChromeFrameActivexBase overrides HRESULT IOleObject_SetClientSite(IOleClientSite* client_site); @@ -216,7 +247,6 @@ END_EXEC_COMMAND_MAP() virtual void OnOpenURL(int tab_handle, const GURL& url_to_open, const GURL& referrer, 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 @@ -262,6 +292,10 @@ END_EXEC_COMMAND_MAP() VARIANT* in_args, VARIANT* out_args); + // Get the travel log from the client site + HRESULT GetBrowserServiceAndTravelLog(IBrowserService** browser_service, + ITravelLog** travel_log); + protected: typedef std::map<int, bool> EnabledCommandsMap; |