Bug 718465 - Part 1: Only send SELECTED tab event if the tab has changed. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 18 Oct 2012 00:01:01 -0700
changeset 110770 8ab0fa5530697e09147353a1725b1b5f48ce9a43
parent 110769 0923556aea0eac9f582e209df5928ca4991faf0f
child 110771 77ac649ce11bad3a4629a7c4208e7a2981937a96
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmfinkle
bugs718465
milestone19.0a1
Bug 718465 - Part 1: Only send SELECTED tab event if the tab has changed. r=mfinkle
mobile/android/base/Tabs.java
--- a/mobile/android/base/Tabs.java
+++ b/mobile/android/base/Tabs.java
@@ -125,17 +125,17 @@ public class Tabs implements GeckoEventL
     public Tab selectTab(int id) {
         if (!mTabs.containsKey(id))
             return null;
 
         final Tab oldTab = getSelectedTab();
         final Tab tab = mTabs.get(id);
         // This avoids a NPE below, but callers need to be careful to
         // handle this case
-        if (tab == null)
+        if (tab == null || oldTab == tab)
             return null;
 
         mSelectedTab = tab;
         mActivity.runOnUiThread(new Runnable() { 
             public void run() {
                 mActivity.hideFormAssistPopup();
                 if (isSelectedTab(tab)) {
                     String url = tab.getURL();