From 05332a74ddf10db2421ba7a62b61abba02ae94d8 Mon Sep 17 00:00:00 2001 From: Brian Nicholson Date: Mon, 7 May 2012 16:54:52 -0700 Subject: [PATCH] Bug 752713 - Only save thumbnail if document stop URL matches tab URL. r=blassey --- mobile/android/base/GeckoApp.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 8974f4b9993..e7814fd061d 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -906,7 +906,7 @@ abstract public class GeckoApp handleDocumentStart(tabId, showProgress, uri); } else if ((state & GeckoAppShell.WPL_STATE_STOP) != 0) { Log.i(LOGTAG, "Got a document stop"); - handleDocumentStop(tabId, success); + handleDocumentStop(tabId, success, uri); } } } else if (event.equals("Content:LoadError")) { @@ -1234,7 +1234,7 @@ abstract public class GeckoApp }); } - void handleDocumentStop(int tabId, boolean success) { + void handleDocumentStop(int tabId, boolean success, final String uri) { final Tab tab = Tabs.getInstance().getTab(tabId); if (tab == null) return; @@ -1250,6 +1250,9 @@ abstract public class GeckoApp }); GeckoAppShell.getHandler().postDelayed(new Runnable() { public void run() { + if (!uri.equals(tab.getURL())) + return; + getAndProcessThumbnailForTab(tab); if (Tabs.getInstance().isSelectedTab(tab)) { GeckoAppShell.sendEventToGecko(GeckoEvent.createStartPaintListentingEvent(tab.getId()));