summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorShimeng (Simon) Wang <swang@google.com>2011-01-14 14:07:16 -0800
committerShimeng (Simon) Wang <swang@google.com>2011-01-14 14:57:34 -0800
commitbfc0ebd2ace64845c11b40ce5dae09347ce0020d (patch)
treeca361a62a9d4b9385a3cdd33032c209c604dc4bd /WebKit/android/jni/WebViewCore.cpp
parent395bf85b78e33e2a6f685669fc07e9d3fcc251cd (diff)
downloadexternal_webkit-bfc0ebd2ace64845c11b40ce5dae09347ce0020d.zip
external_webkit-bfc0ebd2ace64845c11b40ce5dae09347ce0020d.tar.gz
external_webkit-bfc0ebd2ace64845c11b40ce5dae09347ce0020d.tar.bz2
Persist scrollPoint as part of the history item.
Also record scroll point and view scales when webcore scroll offset is changed. This will help history navigation and browser restoration. issue: 2819082 Change-Id: I3e59806d8110127ed9a2e32b917c4176ffa6bf73
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 3de3810..afbf135 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1152,6 +1152,13 @@ void WebViewCore::setScrollOffset(int moveGeneration, int userScrolled, int dx,
m_mainFrame->eventHandler()->sendScrollEvent();
}
+ // Update history item to reflect the new scroll position.
+ // This also helps save the history information when the browser goes to
+ // background, so scroll position will be restored if browser gets
+ // killed while in background.
+ WebCore::HistoryController* history = m_mainFrame->loader()->history();
+ history->saveScrollPositionAndViewStateToItem(history->currentItem());
+
// update the currently visible screen
sendPluginVisibleScreen();
}