summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2012-05-03 15:42:15 -0700
committerMichael Kolb <kolby@google.com>2012-05-07 16:03:33 -0700
commit7286427ee44435acf5f0ccd1146d9d0b15a36d02 (patch)
tree9212c24efe30c10ddb1c02329543daeabe4bf99b
parent52eafbb7601eac6ce0011edeb2a73ffccb6fb751 (diff)
downloadpackages_apps_Browser-7286427ee44435acf5f0ccd1146d9d0b15a36d02.zip
packages_apps_Browser-7286427ee44435acf5f0ccd1146d9d0b15a36d02.tar.gz
packages_apps_Browser-7286427ee44435acf5f0ccd1146d9d0b15a36d02.tar.bz2
Don't capture picture
Bug: 6439427 Change-Id: I7704d8c81bbb9e612faf3a3206cee245e746035b
-rw-r--r--src/com/android/browser/Controller.java7
-rw-r--r--src/com/android/browser/Tab.java10
2 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index ba74e56..2fb465c 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -847,6 +847,7 @@ public class Controller
@Override
public void onPageFinished(Tab tab) {
+ mCrashRecoveryHandler.backupState();
mUi.onTabDataChanged(tab);
// pause the WebView timer and release the wake lock if it is finished
// while BrowserActivity is in pause state.
@@ -864,7 +865,6 @@ public class Controller
@Override
public void onProgressChanged(Tab tab) {
- mCrashRecoveryHandler.backupState();
int newProgress = tab.getLoadProgress();
if (newProgress == 100) {
@@ -885,8 +885,9 @@ public class Controller
// 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 (tab.shouldUpdateThumbnail() &&
+ (tab.inForeground() && !didUserStopLoading()
+ || !tab.inForeground())) {
if (!mHandler.hasMessages(UPDATE_BOOKMARK_THUMBNAIL, tab)) {
mHandler.sendMessageDelayed(mHandler.obtainMessage(
UPDATE_BOOKMARK_THUMBNAIL, 0, 0, tab),
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 712e30a..28734bd 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -185,6 +185,7 @@ class Tab implements PictureListener {
private int mCaptureHeight;
private Bitmap mCapture;
private Handler mHandler;
+ private boolean mUpdateThumbnail;
/**
* See {@link #clearBackStackWhenItemAdded(String)}.
@@ -334,6 +335,7 @@ class Tab implements PictureListener {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
mInPageLoad = true;
+ mUpdateThumbnail = true;
mPageLoadProgress = INITIAL_PROGRESS;
mCurrentState = new PageState(mContext,
view.isPrivateBrowsingEnabled(), url, favicon);
@@ -792,6 +794,9 @@ class Tab implements PictureListener {
mInPageLoad = false;
}
mWebViewController.onProgressChanged(Tab.this);
+ if (mUpdateThumbnail && newProgress == 100) {
+ mUpdateThumbnail = false;
+ }
}
@Override
@@ -1203,6 +1208,10 @@ class Tab implements PictureListener {
};
}
+ public boolean shouldUpdateThumbnail() {
+ return mUpdateThumbnail;
+ }
+
/**
* This is used to get a new ID when the tab has been preloaded, before it is displayed and
* added to TabControl. Preloaded tabs can be created before restoreInstanceState, leading
@@ -1925,7 +1934,6 @@ class Tab implements PictureListener {
@Override
public void onNewPicture(WebView view, Picture picture) {
- //update screenshot
postCapture();
}