Commit b7cc8b43 authored by Ben Murdoch's avatar Ben Murdoch
Browse files

Only update the bookmark screenshot if the page completed loading fully (i.e....

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
parent 04b025c3
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment