summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-02-21 15:04:50 -0800
committerJohn Reck <jreck@google.com>2012-02-21 15:04:50 -0800
commitd98623751ffc44ab04e75f04cfac87db330bc82b (patch)
tree4e706407753af5acd424f5295f7a65b829936b73 /src
parent91efc173da1aa229d466f3405e40437c649e5594 (diff)
downloadpackages_apps_Browser-d98623751ffc44ab04e75f04cfac87db330bc82b.zip
packages_apps_Browser-d98623751ffc44ab04e75f04cfac87db330bc82b.tar.gz
packages_apps_Browser-d98623751ffc44ab04e75f04cfac87db330bc82b.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Controller.java31
1 files changed, 15 insertions, 16 deletions
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 @@ public class Controller
@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 @@ public class Controller
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