void FrameLoaderClientAndroid::transitionToCommittedForNewPage() { ASSERT(m_frame); #ifdef ANDROID_META_SUPPORT // reset metadata settings for the main frame as they are not preserved cross page if (m_frame == m_frame->page()->mainFrame() && m_frame->settings()) m_frame->settings()->resetMetadataSettings(); #endif // Save the old WebViewCore before creating a new FrameView. There is one // WebViewCore per page. Each frame, including the main frame and sub frame, // has a 1:1 FrameView and WebFrameView. WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_frame->view()); Retain(webViewCore); // Save the old WebFrameView's bounds and apply them to the new WebFrameView WebFrameView* oldWebFrameView = static_cast<WebFrameView*> (m_frame->view()->platformWidget()); IntRect bounds = oldWebFrameView->getBounds(); IntRect windowBounds = oldWebFrameView->getWindowBounds(); WebCore::FrameView* oldFrameView = oldWebFrameView->view(); m_frame->createView(bounds.size(), oldFrameView->baseBackgroundColor(), oldFrameView->isTransparent(), IntSize(), false); // Create a new WebFrameView for the new FrameView WebFrameView* newFrameView = new WebFrameView(m_frame->view(), webViewCore); newFrameView->setLocation(bounds.x(), bounds.y()); newFrameView->setSize(bounds.width(), bounds.height()); newFrameView->setWindowBounds(windowBounds.x(), windowBounds.y(), windowBounds.width(), windowBounds.height()); // newFrameView attaches itself to FrameView which Retains the reference, so // call Release for newFrameView Release(newFrameView); // WebFrameView Retains webViewCore, so call Release for webViewCore Release(webViewCore); m_webFrame->transitionToCommitted(m_frame); }