diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 00:28:45 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 00:28:45 +0000 |
commit | 747bca1dea711a6bd3c38dec7e0903bb9e0035a9 (patch) | |
tree | 204c3a6b4a1d38a06c77e75250089130bbf5f603 /chrome_frame | |
parent | 9f701fdbb0388152a3ce5ef01cc9b8fa43a5a315 (diff) | |
download | chromium_src-747bca1dea711a6bd3c38dec7e0903bb9e0035a9.zip chromium_src-747bca1dea711a6bd3c38dec7e0903bb9e0035a9.tar.gz chromium_src-747bca1dea711a6bd3c38dec7e0903bb9e0035a9.tar.bz2 |
Fix a ChromeFrame Back Forward navigation issue which occurs when we modify the IE history
while processing a navigation update received for a tab loading state change. This is incorrectly
treated as an internal navigation which messes up the history.
Fix is to not treat the tab loading state change notification as an internal navigation.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=69096
BUG=69096
TEST=None at this point.
Review URL: http://codereview.chromium.org/6284002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71524 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 23 | ||||
-rw-r--r-- | chrome_frame/chrome_active_document.h | 5 |
2 files changed, 18 insertions, 10 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 3a0a58b..01ce8b6 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -33,6 +33,7 @@ #include "grit/generated_resources.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_dll_resource.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/navigation_types.h" #include "chrome/common/page_zoom.h" @@ -627,7 +628,7 @@ void ChromeActiveDocument::OnNavigationStateChanged( << ", Relative Offset: " << nav_info.relative_offset << ", Index: " << nav_info.navigation_index; - UpdateNavigationState(nav_info); + UpdateNavigationState(nav_info, flags); } void ChromeActiveDocument::OnUpdateTargetUrl( @@ -692,7 +693,7 @@ void ChromeActiveDocument::OnDidNavigate(const NavigationInfo& nav_info) { return; } - UpdateNavigationState(nav_info); + UpdateNavigationState(nav_info, 0); } void ChromeActiveDocument::OnCloseTab() { @@ -707,7 +708,7 @@ void ChromeActiveDocument::OnCloseTab() { } void ChromeActiveDocument::UpdateNavigationState( - const NavigationInfo& new_navigation_info) { + const NavigationInfo& new_navigation_info, int flags) { HRESULT hr = S_OK; bool is_title_changed = (navigation_info_.title != new_navigation_info.title); bool is_ssl_state_changed = @@ -754,7 +755,7 @@ void ChromeActiveDocument::UpdateNavigationState( cf_url.attach_to_external_tab(); bool is_internal_navigation = - IsNewNavigation(new_navigation_info) || is_attach_external_tab_url; + IsNewNavigation(new_navigation_info, flags) || is_attach_external_tab_url; if (new_navigation_info.url.is_valid()) url_.Allocate(UTF8ToWide(new_navigation_info.url.spec()).c_str()); @@ -1364,14 +1365,20 @@ void ChromeActiveDocument::SetWindowDimensions() { } bool ChromeActiveDocument::IsNewNavigation( - const NavigationInfo& new_navigation_info) const { + const NavigationInfo& new_navigation_info, int flags) 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 + // 1. The navigation notification flags passed in as the flags parameter + // is not INVALIDATE_LOAD which indicates that the loading state of the + // tab changed. + // 2. 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. + // 3. The navigation type has changed. + // 4. The url or the referrer are different. + if (flags == TabContents::INVALIDATE_LOAD) + return false; + if (new_navigation_info.navigation_index <= 0) return false; diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index 0050d14..84a6f88 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -369,7 +369,7 @@ END_EXEC_COMMAND_MAP() // A helper method that updates our internal navigation state // as well as IE's navigation state (viz Title and current URL). // The navigation_flags is a TabContents::InvalidateTypes enum - void UpdateNavigationState(const NavigationInfo& nav_info); + void UpdateNavigationState(const NavigationInfo& nav_info, int flags); TabProxy* GetTabProxy() const { if (automation_client_.get()) @@ -442,7 +442,8 @@ END_EXEC_COMMAND_MAP() // Returns true if the NavigationInfo object passed in represents a new // navigation initiated by the renderer. - bool IsNewNavigation(const NavigationInfo& new_navigation_info) const; + bool IsNewNavigation(const NavigationInfo& new_navigation_info, + int flags) const; protected: typedef std::map<int, OLECMDF> CommandStatusMap; |