diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 20:46:14 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 20:46:14 +0000 |
commit | 342de555aab0ff63b7e802edde1f8d1556aed012 (patch) | |
tree | a26fb4509856708ba5dbdbcbb55b5917459db4da /chrome_frame/chrome_active_document.cc | |
parent | b5e0b76de03fd53043b65a0524ab1150edb31d8c (diff) | |
download | chromium_src-342de555aab0ff63b7e802edde1f8d1556aed012.zip chromium_src-342de555aab0ff63b7e802edde1f8d1556aed012.tar.gz chromium_src-342de555aab0ff63b7e802edde1f8d1556aed012.tar.bz2 |
In ChromeFrame in full tab mode at times the address bar would display the old URL.
This would typically occur during redirects or performing back forward operations
when the current and the target URLs were both rendered in ChromeFrame.
A scenario where this would occur is as below:-
1. Navigation to a URL in chrome frame.
2. Clicking on a link which would navigate the current tab to a chrome frame URL.
3. Now hitting back in IE would navigate back. however the address bar would still
display the URL in step 2.
The reason this occurs is step 2 causes a top level navigation in IE via webbrowser::Navigate.
This initiates a navigation sequence which updates the address bar to the URL in step 2.
Eventually we receive navigation updates from chrome where the navigation index is changed due
to a new navigation from step 1 to 2. We end up firing internal navigation events which cause
the IE history to get messed up leading to the problem.
Fix is to only fire internal navigation events if the following are true.
1. navigation indexes are different.
2. urls are different.
3. referrer differs.
4. navigation type is different.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=57207
Bug=57207
Test=Will send out a test in a separate CL. Need to brush up on using accessibility for
link clicks, etc.
Review URL: http://codereview.chromium.org/3988004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63414 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_active_document.cc')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index d41b1fa..141a544 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -735,9 +735,9 @@ void ChromeActiveDocument::UpdateNavigationState( ChromeFrameUrl cf_url; bool is_attach_external_tab_url = cf_url.Parse(std::wstring(url_)) && cf_url.attach_to_external_tab(); - bool is_internal_navigation = ((new_navigation_info.navigation_index > 0) && - (new_navigation_info.navigation_index != - navigation_info_.navigation_index)) || is_attach_external_tab_url; + + bool is_internal_navigation = + IsNewNavigation(new_navigation_info) || is_attach_external_tab_url; if (new_navigation_info.url.is_valid()) url_.Allocate(UTF8ToWide(new_navigation_info.url.spec()).c_str()); @@ -1306,3 +1306,32 @@ void ChromeActiveDocument::SetWindowDimensions() { dimensions_.set_width(0); } } + +bool ChromeActiveDocument::IsNewNavigation( + const IPC::NavigationInfo& new_navigation_info) const { + // A new navigation is typically an internal navigation which is initiated by + // the renderer(WebKit). Condition 1 below has to be true along with the + // any of the other conditions below. + // 1. The navigation index is greater than 0 which means that a top level + // navigation was initiated on the current external tab. + // 2. The navigation type has changed. + // 3. The url or the referrer are different. + if (new_navigation_info.navigation_index <= 0) + return false; + + if (new_navigation_info.navigation_index == + navigation_info_.navigation_index) + return false; + + if (new_navigation_info.navigation_type != navigation_info_.navigation_type) + return true; + + if (new_navigation_info.url != navigation_info_.url) + return true; + + if (new_navigation_info.referrer != navigation_info_.referrer) + return true; + + return false; +} + |