diff options
author | Narayan Kamath <narayan@google.com> | 2011-07-20 14:36:22 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2011-07-20 14:36:22 +0100 |
commit | c8892c7975dee647c65b52fb9350e5c3858bcf8b (patch) | |
tree | 0c28d8fe85a53bfc9d935a9c2a71b2929a96885e /src/com/android/browser/PreloadController.java | |
parent | 6265b744c3097c24e42ee62ca0969ab9c4d6a91b (diff) | |
download | packages_apps_browser-c8892c7975dee647c65b52fb9350e5c3858bcf8b.zip packages_apps_browser-c8892c7975dee647c65b52fb9350e5c3858bcf8b.tar.gz packages_apps_browser-c8892c7975dee647c65b52fb9350e5c3858bcf8b.tar.bz2 |
Clear prerender history when loading a new page.
Following the recommendation in the bug below.
bug:5030881
Change-Id: Iae1e432e735e443ab03ec1bda6576db638a674a0
Diffstat (limited to 'src/com/android/browser/PreloadController.java')
-rw-r--r-- | src/com/android/browser/PreloadController.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/browser/PreloadController.java b/src/com/android/browser/PreloadController.java index 11586ea..652ea8e 100644 --- a/src/com/android/browser/PreloadController.java +++ b/src/com/android/browser/PreloadController.java @@ -81,11 +81,25 @@ public class PreloadController implements WebViewController { @Override public void onPageStarted(Tab tab, WebView view, Bitmap favicon) { if (LOGD_ENABLED) Log.d(LOGTAG, "onPageStarted()"); + if (view != null) { + // Clear history of all previously visited pages. When the + // user visits a preloaded tab, the only item in the history + // list should the currently viewed page. + view.clearHistory(); + } } @Override public void onPageFinished(Tab tab) { if (LOGD_ENABLED) Log.d(LOGTAG, "onPageFinished()"); + if (tab != null) { + final WebView view = tab.getWebView(); + if (view != null) { + // Clear history of all previously visited pages. When the + // user visits a preloaded tab. + view.clearHistory(); + } + } } @Override |