Bug 1251362 - Part 10 - Display a context menu for closed tab entries. r=liuche
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 14 May 2016 19:42:00 +0200
changeset 301163 ab0c1b005ffe6f628e1d4170e19ff02fa255ba1a
parent 301162 8c7176aa08d7e4baa4f7848a2e0731d893f8d66c
child 301164 7c334cfa74a08d1a1a0219835af6e54007d65b20
push id78241
push userkwierso@gmail.com
push dateThu, 09 Jun 2016 00:09:10 +0000
treeherdermozilla-inbound@2c66b75bbb7f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs1251362
milestone50.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 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;
+    }
 }