From b7cc8b439dc595dc48e1c2183b35d23ad72dfbe5 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Mon, 28 Sep 2009 10:59:09 +0100 Subject: Only update the bookmark screenshot if the page completed loading fully (i.e. do not save a screenshot if the user canceled loading. Bug: 2148161 Change-Id: Ia226959cd18848d0eb2e302a9ef894c5c142d37d --- src/com/android/browser/BrowserActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 91d4fd1..fd06d90 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -2276,6 +2276,7 @@ public class BrowserActivity extends Activity } /* package */ void stopLoading() { + mDidStopLoad = true; resetTitleAndRevertLockIcon(); WebView w = getTopWindow(); w.stopLoading(); @@ -2557,6 +2558,7 @@ public class BrowserActivity extends Activity CookieSyncManager.getInstance().resetSync(); mInLoad = true; + mDidStopLoad = false; showFakeTitleBar(); updateInLoadMenuItems(); if (!mIsNetworkUp) { @@ -2572,7 +2574,12 @@ public class BrowserActivity extends Activity // Reset the title and icon in case we stopped a provisional // load. resetTitleAndIcon(view); - updateScreenshot(view); + + if (!mDidStopLoad) { + // Only update the bookmark screenshot if the user did not + // cancel the load early. + updateScreenshot(view); + } // Update the lock icon image only once we are done loading updateLockIconToLatest(); @@ -4394,6 +4401,7 @@ public class BrowserActivity extends Activity private boolean mInLoad; private boolean mIsNetworkUp; + private boolean mDidStopLoad; private boolean mPageStarted; private boolean mActivityInPause = true; -- cgit v1.1