From be33b78f63b17f1b6f5a36a503d797d5f9b941ee Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 26 Nov 2009 14:58:02 +0000 Subject: Android History unforking pt4: Android specific changes to makefiles and other code that has not been upstreamed yet (i.e. WebKit/android). This does NOT need to be upstreamed to WebKit (yet). Change-Id: I821fb90c3e463ef5fc4fa001ee5b8d967f9f7e48 --- .../WebCoreSupport/FrameLoaderClientAndroid.cpp | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp') diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index 6338e26..ea1f327 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -737,12 +737,11 @@ void FrameLoaderClientAndroid::frameLoadCompleted() { } void FrameLoaderClientAndroid::saveViewStateToItem(HistoryItem* item) { -#ifdef ANDROID_HISTORY_CLIENT ASSERT(m_frame); ASSERT(item); // We should have added a bridge when the child item was added to its // parent. - WebHistoryItem* bridge = item->bridge(); + AndroidWebHistoryBridge* bridge = item->bridge(); ASSERT(bridge); // store the current scale (only) for the top frame if (!m_frame->tree()->parent()) { @@ -752,41 +751,38 @@ void FrameLoaderClientAndroid::saveViewStateToItem(HistoryItem* item) { } WebCore::notifyHistoryItemChanged(item); -#endif } void FrameLoaderClientAndroid::restoreViewState() { -#ifdef ANDROID_HISTORY_CLIENT WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_frame->view()); HistoryItem* item = m_frame->loader()->history()->currentItem(); + AndroidWebHistoryBridge* bridge = item->bridge(); // restore the scale (only) for the top frame if (!m_frame->tree()->parent()) { - int scale = item->bridge()->scale(); + int scale = bridge->scale(); webViewCore->restoreScale(scale); - int screenWidthScale = item->bridge()->screenWidthScale(); + int screenWidthScale = bridge->screenWidthScale(); if (screenWidthScale != scale) webViewCore->restoreScreenWidthScale(screenWidthScale); } -#endif } -#ifdef ANDROID_HISTORY_CLIENT -void FrameLoaderClientAndroid::dispatchDidAddHistoryItem(HistoryItem* item) const { +void FrameLoaderClientAndroid::dispatchDidAddBackForwardItem(HistoryItem* item) const { ASSERT(m_frame); m_webFrame->addHistoryItem(item); } -void FrameLoaderClientAndroid::dispatchDidRemoveHistoryItem(HistoryItem* item, int index) const { +void FrameLoaderClientAndroid::dispatchDidRemoveBackForwardItem(HistoryItem* item) const { ASSERT(m_frame); - m_webFrame->removeHistoryItem(index); + m_webFrame->removeHistoryItem(0); } -void FrameLoaderClientAndroid::dispatchDidChangeHistoryIndex( - BackForwardList* list) const { +void FrameLoaderClientAndroid::dispatchDidChangeBackForwardIndex() const { ASSERT(m_frame); + BackForwardList* list = m_frame->page()->backForwardList(); + ASSERT(list); m_webFrame->updateHistoryIndex(list->backListCount()); } -#endif void FrameLoaderClientAndroid::provisionalLoadStarted() { ASSERT(m_frame); -- cgit v1.1