Bug 753845 - Fix race condition in setting/reading the selected tab. r=margaret

This commit is contained in:
Kartikaya Gupta 2012-05-10 13:41:00 -04:00
parent dd1b0e7adc
commit e0ff9d5710

View File

@ -127,10 +127,10 @@ public class Tabs implements GeckoEventListener {
else
GeckoApp.mAppContext.hideAboutHome();
selectedTab = tab;
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
public void run() {
GeckoApp.mFormAssistPopup.hide();
// Do we need to do this check?
if (isSelectedTab(tab)) {
String url = tab.getURL();
GeckoApp.mBrowserToolbar.setTitle(tab.getDisplayTitle());
@ -149,7 +149,7 @@ public class Tabs implements GeckoEventListener {
// Pass a message to Gecko to update tab state in BrowserApp
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Tab:Selected", String.valueOf(tab.getId())));
return selectedTab = tab;
return tab;
}
public int getIndexOf(Tab tab) {