diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 19:48:06 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 19:48:06 +0000 |
commit | 0aa22e2feda12ca6a9e9f26a084a2307acfcc080 (patch) | |
tree | 22442de31cd390091fb7bc338f3ade0b5f689d3a /chrome_frame/bho.h | |
parent | 591948964e3088901b3d66fee2837446700d9083 (diff) | |
download | chromium_src-0aa22e2feda12ca6a9e9f26a084a2307acfcc080.zip chromium_src-0aa22e2feda12ca6a9e9f26a084a2307acfcc080.tar.gz chromium_src-0aa22e2feda12ca6a9e9f26a084a2307acfcc080.tar.bz2 |
When ChromeFrame switches to IE on receiving the OnHttpEquiv notification indicating the presence of a meta
tag indicating that the page is to be rendered in Chrome, we check if the notification is received for a
site rendered in an IFrame to ensure that we don't switch in this case. This code is not reliable and we end
up assuming that a top level navigation is actually an embedded frame.
To work around this we now maintain a pending navigation count in BeforeNavigate2, which is decremented in
NavigateComplete2 and NavigateError. We perform the check for an embedded document only if the pending navigation
count is greater than 1.
This fixes http://code.google.com/p/chromium/issues/detail?id=36825
The other change made is to add a delay of 100ms in SendString between each character to better reflect actual
timing for real user input.
Bug=36825
Review URL: http://codereview.chromium.org/837008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41463 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/bho.h')
-rw-r--r-- | chrome_frame/bho.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome_frame/bho.h b/chrome_frame/bho.h index c82f000..5992746 100644 --- a/chrome_frame/bho.h +++ b/chrome_frame/bho.h @@ -64,6 +64,10 @@ END_COM_MAP() BEGIN_SINK_MAP(Bho) SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, BeforeNavigate2, &kBeforeNavigate2Info) + SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_NAVIGATECOMPLETE2, + NavigateComplete2, &kNavigateComplete2Info) + SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_NAVIGATEERROR, + OnNavigateError, &kNavigateErrorInfo) END_SINK_MAP() // Lifetime management methods @@ -74,10 +78,17 @@ END_SINK_MAP() // IObjectWithSite STDMETHODIMP SetSite(IUnknown* site); + STDMETHOD(BeforeNavigate2)(IDispatch* dispatch, VARIANT* url, VARIANT* flags, VARIANT* target_frame_name, VARIANT* post_data, VARIANT* headers, VARIANT_BOOL* cancel); + STDMETHOD_(void, NavigateComplete2)(IDispatch* dispatch, VARIANT* url); + + STDMETHOD_(void, OnNavigateError)(IDispatch* dispatch, VARIANT* url, + VARIANT* frame_name, VARIANT* status_code, + VARIANT* cancel); + HRESULT NavigateToCurrentUrlInCF(IBrowserService* browser); // mshtml sends an IOleCommandTarget::Exec of OLECMDID_HTTPEQUIV @@ -113,6 +124,10 @@ END_SINK_MAP() static void ProcessOptInUrls(IWebBrowser2* browser, BSTR url); + int pending_navigation_count() const { + return pending_navigation_count_; + } + protected: bool PatchProtocolHandler(const CLSID& handler_clsid); @@ -122,6 +137,14 @@ END_SINK_MAP() static base::LazyInstance<base::ThreadLocalPointer<Bho> > bho_current_thread_instance_; static _ATL_FUNC_INFO kBeforeNavigate2Info; + static _ATL_FUNC_INFO kNavigateComplete2Info; + static _ATL_FUNC_INFO kNavigateErrorInfo; + + // This variable holds the pending navigation count seen by the BHO. It is + // incremented in BeforeNavigate2 and decremented in NavigateComplete2. + // Used to determine whether there are embedded frames loading for the + // current document. + int pending_navigation_count_; }; #endif // CHROME_FRAME_BHO_H_ |