Bug 1251362 - Part 10 - Display a context menu for closed tab entries. r=liuche draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 14 May 2016 19:42:00 +0200
changeset 376078 4e8c2219cd7f9ecce454be55014429485aa60ad5
parent 376077 4e43739443def5fce6d7eaf8051ed40e2b2b3602
child 376079 c13f797a595a81465ef998fedcb03f0dd3187b74
push id20500
push usermozilla@buttercookie.de
push dateTue, 07 Jun 2016 11:41:20 +0000
reviewersliuche
bugs1251362
milestone50.0a1
Bug 1251362 - Part 10 - Display a context menu for closed tab entries. r=liuche MozReview-Commit-ID: Gv2tJoNRldX
mobile/android/base/java/org/mozilla/gecko/home/RecentTabsAdapter.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/RecentTabsAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/RecentTabsAdapter.java
@@ -357,11 +357,24 @@ public class RecentTabsAdapter extends R
         return closedTab;
     }
 
     @Override
     public HomeContextMenuInfo makeContextMenuInfoFromPosition(View view, int position) {
         final CombinedHistoryItem.ItemType itemType = getItemTypeForPosition(position);
         final HomeContextMenuInfo info;
 
+        switch (itemType) {
+            case CLOSED_TAB:
+                info = new HomeContextMenuInfo(view, position, -1);
+                ClosedTab closedTab = getClosedTabForPosition(position);
+                return populateChildInfoFromTab(info, closedTab);
+        }
+
         return null;
     }
+
+    protected static HomeContextMenuInfo populateChildInfoFromTab(HomeContextMenuInfo info, ClosedTab tab) {
+        info.url = tab.url;
+        info.title = tab.title;
+        return info;
+    }
 }