summaryrefslogtreecommitdiffstats
path: root/chrome_frame/bho.cc
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 20:50:11 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 20:50:11 +0000
commit502415277b63821cc18422e177b73de41985bec6 (patch)
tree9625e2de0cef611528ee73b2f8d43c1a58245e7f /chrome_frame/bho.cc
parent15d8edb4918b3729fc72200f5c19a67409fc0180 (diff)
downloadchromium_src-502415277b63821cc18422e177b73de41985bec6.zip
chromium_src-502415277b63821cc18422e177b73de41985bec6.tar.gz
chromium_src-502415277b63821cc18422e177b73de41985bec6.tar.bz2
Reverting due to two broken tests: FullTabModeIE_SubIFram and FullTabModeIE_UnloadEventTest.
Revert 41463 - 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 TBR=ananta@chromium.org Review URL: http://codereview.chromium.org/877009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/bho.cc')
-rw-r--r--chrome_frame/bho.cc57
1 files changed, 9 insertions, 48 deletions
diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc
index 5c9fc89..e275707 100644
--- a/chrome_frame/bho.cc
+++ b/chrome_frame/bho.cc
@@ -47,24 +47,7 @@ _ATL_FUNC_INFO Bho::kBeforeNavigate2Info = {
}
};
-_ATL_FUNC_INFO Bho::kNavigateComplete2Info = {
- CC_STDCALL, VT_EMPTY, 2, {
- VT_DISPATCH,
- VT_VARIANT | VT_BYREF
- }
-};
-
-_ATL_FUNC_INFO Bho::kNavigateErrorInfo = {
- CC_STDCALL, VT_EMPTY, 5, {
- VT_DISPATCH,
- VT_VARIANT | VT_BYREF,
- VT_VARIANT | VT_BYREF,
- VT_VARIANT | VT_BYREF,
- VT_BOOL | VT_BYREF,
- }
-};
-
-Bho::Bho() : pending_navigation_count_(0) {
+Bho::Bho() {
}
HRESULT Bho::FinalConstruct() {
@@ -132,27 +115,10 @@ STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url,
referrer_.clear();
}
url_ = url->bstrVal;
- pending_navigation_count_++;
ProcessOptInUrls(web_browser2, url->bstrVal);
return S_OK;
}
-STDMETHODIMP_(void) Bho::NavigateComplete2(IDispatch* dispatch,
- VARIANT* url) {
- DLOG(INFO) << "In NavigateComplete2 for url:" << url->bstrVal;
- pending_navigation_count_--;
- DCHECK(pending_navigation_count_ >= 0);
-}
-
-STDMETHODIMP_(void) Bho::OnNavigateError(IDispatch* dispatch, VARIANT* url,
- VARIANT* frame_name,
- VARIANT* status_code,
- VARIANT* cancel) {
- DLOG(INFO) << "In NavigateError for url:" << url->bstrVal;
- pending_navigation_count_--;
- DCHECK(pending_navigation_count_ >= 0);
-}
-
HRESULT Bho::NavigateToCurrentUrlInCF(IBrowserService* browser) {
DCHECK(browser);
MarkBrowserOnThreadForCFNavigation(browser);
@@ -226,13 +192,7 @@ void ClearDocumentContents(IUnknown* browser) {
// Returns true if the currently loaded document in the browser has
// any embedded items such as a frame or an iframe.
-bool DocumentHasEmbeddedItems(IUnknown* browser,
- int pending_navigation_count) {
- // For a document with embedded frames the pending navigation count will be
- // greater than 1.
- if (pending_navigation_count <= 1)
- return false;
-
+bool DocumentHasEmbeddedItems(IUnknown* browser) {
bool has_embedded_items = false;
ScopedComPtr<IWebBrowser2> web_browser2;
@@ -278,12 +238,12 @@ HRESULT Bho::OnHttpEquiv(IBrowserService_OnHttpEquiv_Fn original_httpequiv,
// notification is coming from those and not the top level document.
// The embedded items should only be created once the top level
// doc has been created.
- Bho* bho = Bho::GetCurrentThreadBhoInstance();
- DCHECK(bho);
- if (bho) {
- if (!DocumentHasEmbeddedItems(browser, bho->pending_navigation_count())) {
- DLOG(INFO) << "Found tag in page. Marking browser." << bho->url() <<
- StringPrintf(" tid=0x%08X", ::GetCurrentThreadId());
+ if (!DocumentHasEmbeddedItems(browser)) {
+ Bho* bho = Bho::GetCurrentThreadBhoInstance();
+ DCHECK(bho);
+ DLOG(INFO) << "Found tag in page. Marking browser." << bho->url() <<
+ StringPrintf(" tid=0x%08X", ::GetCurrentThreadId());
+ if (bho) {
// TODO(tommi): See if we can't figure out a cleaner way to avoid
// this. For some documents we can hit a problem here. When we
// attempt to navigate the document again in CF, mshtml can "complete"
@@ -298,6 +258,7 @@ HRESULT Bho::OnHttpEquiv(IBrowserService_OnHttpEquiv_Fn original_httpequiv,
}
}
}
+
return original_httpequiv(browser, shell_view, done, in_arg, out_arg);
}