Bug 1080374 - Update 'Switch to tab' display on tab LOCATION_CHANGE, r=margaret
authorMark Capella <markcapella@twcny.rr.com>
Fri, 31 Oct 2014 23:31:20 -0400
changeset 213530 c8eefd3e3ac36142c2519c7e2c407ae944211176
parent 213529 a9902edc4870d0a2d2acee34f5a13aa180d0b0e1
child 213531 1ed7cff1a04a4e83396666b46ff229694cc11181
push id27754
push userphilringnalda@gmail.com
push dateSun, 02 Nov 2014 16:56:35 +0000
treeherdermozilla-central@6ca3405c22e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1080374
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1080374 - Update 'Switch to tab' display on tab LOCATION_CHANGE, r=margaret
mobile/android/base/home/TwoLinePageRow.java
--- a/mobile/android/base/home/TwoLinePageRow.java
+++ b/mobile/android/base/home/TwoLinePageRow.java
@@ -124,22 +124,24 @@ public class TwoLinePageRow extends Line
      */
     @Override
     public void onTabChanged(final Tab tab, final Tabs.TabEvents msg, final Object data) {
         // Carefully check if this tab event is relevant to this row.
         final String pageUrl = mPageUrl;
         if (pageUrl == null) {
             return;
         }
-        final String tabUrl;
         if (tab == null) {
             return;
         }
-        tabUrl = tab.getURL();
-        if (!pageUrl.equals(tabUrl)) {
+
+        // Return early if the page URL doesn't match the current tab URL,
+        // or the old tab URL.
+        final String tabUrl = tab.getURL();
+        if (!pageUrl.equals(tabUrl) && !pageUrl.equals(data)) {
             return;
         }
 
         switch (msg) {
             case ADDED:
             case CLOSED:
             case LOCATION_CHANGE:
                 updateDisplayedUrl();