Bug 1251362 - Part 10 - Display a context menu for closed tab entries. r=liuche
MozReview-Commit-ID: Gv2tJoNRldX
--- 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;
+ }
}