Move thumbnail update to onProgressChanged

 Bug: 5960873
 onPageFinished happens with in-page navigation, but onProgressChanged
 doesn't. Use that to avoid taking unnecessary thumbnail captures

Change-Id: Ifbc83e3f654c81cc01d52a6ece129f96e888bf67
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 86704d3..ec7cb66 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -840,22 +840,6 @@
     @Override
     public void onPageFinished(Tab tab) {
         mUi.onTabDataChanged(tab);
-        if (!tab.isPrivateBrowsingEnabled()
-                && !TextUtils.isEmpty(tab.getUrl())
-                && !tab.isSnapshot()
-                && !tab.inPageLoad()) {
-            // Only update the bookmark screenshot if the user did not
-            // cancel the load early and there is not already
-            // a pending update for the tab.
-            if (tab.inForeground() && !didUserStopLoading()
-                    || !tab.inForeground()) {
-                if (!mHandler.hasMessages(UPDATE_BOOKMARK_THUMBNAIL, tab)) {
-                    mHandler.sendMessageDelayed(mHandler.obtainMessage(
-                            UPDATE_BOOKMARK_THUMBNAIL, 0, 0, tab),
-                            500);
-                }
-            }
-        }
         // pause the WebView timer and release the wake lock if it is finished
         // while BrowserActivity is in pause state.
         if (mActivityPaused && pauseWebViewTimers(tab)) {
@@ -887,6 +871,21 @@
             if (tab.inPageLoad()) {
                 updateInLoadMenuItems(mCachedMenu, tab);
             }
+            if (!tab.isPrivateBrowsingEnabled()
+                    && !TextUtils.isEmpty(tab.getUrl())
+                    && !tab.isSnapshot()) {
+                // Only update the bookmark screenshot if the user did not
+                // cancel the load early and there is not already
+                // a pending update for the tab.
+                if (tab.inForeground() && !didUserStopLoading()
+                        || !tab.inForeground()) {
+                    if (!mHandler.hasMessages(UPDATE_BOOKMARK_THUMBNAIL, tab)) {
+                        mHandler.sendMessageDelayed(mHandler.obtainMessage(
+                                UPDATE_BOOKMARK_THUMBNAIL, 0, 0, tab),
+                                500);
+                    }
+                }
+            }
         } else {
             if (!tab.inPageLoad()) {
                 // onPageFinished may have already been called but a subframe is