OSDN Git Service

If the server redirected us, use the url instead of the urlForHistory.
authorPatrick Scott <phanna@android.com>
Thu, 4 Jun 2009 15:08:53 +0000 (11:08 -0400)
committerPatrick Scott <phanna@android.com>
Thu, 4 Jun 2009 15:08:53 +0000 (11:08 -0400)
This change will allow a new entry to be added to the visited history and will
correctly update that new item when the title arrives. Another change in
BrowserActivity fixes the title bar during the redirect.

WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp

index a99fedd..d8d45fe 100644 (file)
@@ -569,7 +569,13 @@ void FrameLoaderClientAndroid::finishedLoading(DocumentLoader* docLoader) {
 void FrameLoaderClientAndroid::updateGlobalHistory() {
     ASSERT(m_frame);
     ASSERT(m_frame->loader()->documentLoader());
-    m_webFrame->updateVisitedHistory(m_frame->loader()->documentLoader()->urlForHistory(), false);
+    KURL url;
+    DocumentLoader* loader = m_frame->loader()->documentLoader();
+    if (loader->urlForHistoryReflectsServerRedirect())
+        url = loader->url();
+    else
+        url = loader->urlForHistory();
+    m_webFrame->updateVisitedHistory(url, false);
 }
 
 void FrameLoaderClientAndroid::updateGlobalHistoryForRedirectWithoutHistoryItem() {