Bug 1261527 - Move code around. r=sebastian
authorChenxia Liu <liuche@mozilla.com>
Fri, 22 Apr 2016 16:13:26 -0700
changeset 362655 63ed19698b26d4a96c8573ad241dd5bdc74c9f56
parent 362654 ac956fe95aa3f4ffd32537dedec89b7262baf650
child 362656 0003c0e701e62018604dd7566e6cb5a08515541b
push id17008
push userbgrinstead@mozilla.com
push dateMon, 02 May 2016 21:59:43 +0000
reviewerssebastian
bugs1261527
milestone49.0a1
Bug 1261527 - Move code around. r=sebastian MozReview-Commit-ID: LjgydyMLVER
mobile/android/base/java/org/mozilla/gecko/home/ClientsAdapter.java
mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryPanel.java
mobile/android/base/java/org/mozilla/gecko/home/HistorySectionsHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/ClientsAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/ClientsAdapter.java
@@ -106,16 +106,31 @@ public class ClientsAdapter extends Recy
         }
     }
 
     @Override
     public int getItemCount () {
         return adapterList.size();
     }
 
+    private CombinedHistoryItem.ItemType getItemTypeForPosition(int position) {
+        if (position == 0) {
+            return NAVIGATION_BACK;
+        }
+
+        final Pair<String, Integer> pair = adapterList.get(position);
+        if (pair == null) {
+            return HIDDEN_DEVICES;
+        } else if (pair.second == -1) {
+            return CLIENT;
+        } else {
+            return CHILD;
+        }
+    }
+
     @Override
     public int getItemViewType(int position) {
         return CombinedHistoryItem.ItemType.itemTypeToViewType(getItemTypeForPosition(position));
     }
 
     @UiThread
     public void setClients(List<RemoteClient> clients) {
         adapterList.clear();
@@ -149,16 +164,20 @@ public class ClientsAdapter extends Recy
         if (!sState.isClientCollapsed(client.guid)) {
             for (int i = 0; i < client.tabs.size(); i++) {
                 list.add(new Pair<>(guid, i));
             }
         }
         return list;
     }
 
+    public List<RemoteClient> getHiddenClients() {
+        return hiddenClients;
+    }
+
     public void toggleClient(int position) {
         final Pair<String, Integer> pair = adapterList.get(position);
         if (pair.second != -1) {
             return;
         }
 
         final String clientGuid = pair.first;
         final RemoteClient client = visibleClients.get(clientGuid);
@@ -177,47 +196,16 @@ public class ClientsAdapter extends Recy
                 i--;
             }
             notifyItemRangeRemoved(position + 1, client.tabs.size());
         }
         // TODO: Update arrow direction of expanded state.
         sState.setClientCollapsed(clientGuid, !isCollapsed);
     }
 
-    public void removeItem(int position) {
-        final CombinedHistoryItem.ItemType itemType = getItemTypeForPosition(position);
-        switch (itemType) {
-            case CLIENT:
-                final String clientGuid = adapterList.get(position).first;
-                final RemoteClient client = visibleClients.remove(clientGuid);
-                final boolean hadHiddenClients = !hiddenClients.isEmpty();
-
-                int removeCount = sState.isClientCollapsed(clientGuid) ? 1 : client.tabs.size() + 1;
-                int c = removeCount;
-                while (c > 0) {
-                    adapterList.remove(position);
-                    c--;
-                }
-                notifyItemRangeRemoved(position, removeCount);
-
-                sState.setClientHidden(clientGuid, true);
-                hiddenClients.add(client);
-
-                if (!hadHiddenClients) {
-                    // Add item for unhiding clients;
-                    adapterList.add(null);
-                    notifyItemInserted(adapterList.size() - 1);
-                } else {
-                    // Update "hidden clients" item because number of hidden clients changed.
-                    notifyItemChanged(adapterList.size() - 1);
-                }
-                break;
-        }
-    }
-
     public void unhideClients(List<RemoteClient> selectedClients) {
         final int numClients = selectedClients.size();
         if (numClients == 0) {
             return;
         }
 
         final int insertionIndex = adapterList.size() - 1;
         int itemCount = numClients;
@@ -243,45 +231,63 @@ public class ClientsAdapter extends Recy
             adapterList.remove(hiddenDevicesIndex);
             notifyItemRemoved(hiddenDevicesIndex);
         } else {
             // Update "hidden clients" item because number of hidden clients changed.
             notifyItemChanged(hiddenDevicesIndex);
         }
     }
 
+    public void removeItem(int position) {
+        final CombinedHistoryItem.ItemType itemType = getItemTypeForPosition(position);
+        switch (itemType) {
+            case CLIENT:
+                final String clientGuid = adapterList.get(position).first;
+                final RemoteClient client = visibleClients.remove(clientGuid);
+                final boolean hadHiddenClients = !hiddenClients.isEmpty();
 
-    public List<RemoteClient> getHiddenClients() {
-        return hiddenClients;
+                int removeCount = sState.isClientCollapsed(clientGuid) ? 1 : client.tabs.size() + 1;
+                int c = removeCount;
+                while (c > 0) {
+                    adapterList.remove(position);
+                    c--;
+                }
+                notifyItemRangeRemoved(position, removeCount);
+
+                sState.setClientHidden(clientGuid, true);
+                hiddenClients.add(client);
+
+                if (!hadHiddenClients) {
+                    // Add item for unhiding clients;
+                    adapterList.add(null);
+                    notifyItemInserted(adapterList.size() - 1);
+                } else {
+                    // Update "hidden clients" item because number of hidden clients changed.
+                    notifyItemChanged(adapterList.size() - 1);
+                }
+                break;
+        }
     }
 
     @Override
     public HomeContextMenuInfo makeContextMenuInfoFromPosition(View view, int position) {
         final CombinedHistoryItem.ItemType itemType = getItemTypeForPosition(position);
         HomeContextMenuInfo info;
         final Pair<String, Integer> pair = adapterList.get(position);
         switch (itemType) {
             case CHILD:
                 info = new HomeContextMenuInfo(view, position, -1);
-                return CombinedHistoryPanel.populateChildInfoFromTab(info, visibleClients.get(pair.first).tabs.get(pair.second));
+                return populateChildInfoFromTab(info, visibleClients.get(pair.first).tabs.get(pair.second));
 
             case CLIENT:
                 info = new CombinedHistoryPanel.RemoteTabsClientContextMenuInfo(view, position, -1, visibleClients.get(pair.first));
                 return info;
         }
         return null;
     }
 
-    private CombinedHistoryItem.ItemType getItemTypeForPosition(int position) {
-        if (position == 0) {
-            return NAVIGATION_BACK;
-        }
+    protected static HomeContextMenuInfo populateChildInfoFromTab(HomeContextMenuInfo info, RemoteTab tab) {
+        info.url = tab.url;
+        info.title = tab.title;
+        return info;
+    }
 
-        final Pair<String, Integer> pair = adapterList.get(position);
-        if (pair == null) {
-            return HIDDEN_DEVICES;
-        } else if (pair.second == -1) {
-            return CLIENT;
-        } else {
-            return CHILD;
-        }
-    }
 }
--- a/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
@@ -1,39 +1,58 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 package org.mozilla.gecko.home;
 
+import android.content.res.Resources;
 import android.support.v7.widget.RecyclerView;
 
 import android.database.Cursor;
 import android.util.SparseArray;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.TextView;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.db.BrowserContract;
-import org.mozilla.gecko.home.CombinedHistoryPanel.SectionHeader;
+import org.mozilla.gecko.db.RemoteTab;
 
 public class CombinedHistoryAdapter extends RecyclerView.Adapter<CombinedHistoryItem> implements CombinedHistoryRecyclerView.AdapterContextMenuBuilder {
     private static final int SYNCED_DEVICES_SMARTFOLDER_INDEX = 0;
 
+    // Array for the time ranges in milliseconds covered by each section.
+    static final HistorySectionsHelper.SectionDateRange[] sectionDateRangeArray = new HistorySectionsHelper.SectionDateRange[SectionHeader.values().length];
+
+    // Semantic names for the time covered by each section
+    public enum SectionHeader {
+        TODAY,
+        YESTERDAY,
+        WEEK,
+        THIS_MONTH,
+        MONTH_AGO,
+        TWO_MONTHS_AGO,
+        THREE_MONTHS_AGO,
+        FOUR_MONTHS_AGO,
+        FIVE_MONTHS_AGO,
+        OLDER_THAN_SIX_MONTHS
+    }
+
     private Cursor historyCursor;
     private DevicesUpdateHandler devicesUpdateHandler;
     private int deviceCount = 0;
 
     // We use a sparse array to store each section header's position in the panel [more cheaply than a HashMap].
-    private final SparseArray<CombinedHistoryPanel.SectionHeader> sectionHeaders;
+    private final SparseArray<SectionHeader> sectionHeaders;
 
-    public CombinedHistoryAdapter() {
+    public CombinedHistoryAdapter(Resources resources) {
         super();
         sectionHeaders = new SparseArray<>();
+        HistorySectionsHelper.updateRecentSectionOffset(resources, sectionDateRangeArray);
     }
 
     public void setHistory(Cursor history) {
         historyCursor = history;
         populateSectionHeaders(historyCursor, sectionHeaders);
         notifyDataSetChanged();
     }
 
@@ -49,43 +68,16 @@ public class CombinedHistoryAdapter exte
                     deviceCount = count;
                     notifyItemChanged(0);
                 }
             };
         }
         return devicesUpdateHandler;
     }
 
-    /**
-     * Transform an adapter position to the position for the data structure backing the item type.
-     *
-     * The type is not strictly necessary and could be fetched from <code>getItemTypeForPosition</code>,
-     * but is used for explicitness.
-     *
-     * @param type ItemType of the item
-     * @param position position in the adapter
-     * @return position of the item in the data structure
-     */
-    private int transformAdapterPositionForDataStructure(CombinedHistoryItem.ItemType type, int position) {
-        if (type == CombinedHistoryItem.ItemType.SECTION_HEADER) {
-            return position;
-        } else if (type == CombinedHistoryItem.ItemType.HISTORY){
-            return position - getHeadersBefore(position) - CombinedHistoryPanel.NUM_SMART_FOLDERS;
-        } else {
-            return position;
-        }
-    }
-
-    @Override
-    public HomeContextMenuInfo makeContextMenuInfoFromPosition(View view, int position) {
-        HomeContextMenuInfo info = new HomeContextMenuInfo(view, position, -1);
-        historyCursor.moveToPosition(transformAdapterPositionForDataStructure(CombinedHistoryItem.ItemType.HISTORY, position));
-        return CombinedHistoryPanel.populateHistoryInfoFromCursor(info, historyCursor);
-    }
-
     @Override
     public CombinedHistoryItem onCreateViewHolder(ViewGroup viewGroup, int viewType) {
         final LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext());
         final View view;
 
         final CombinedHistoryItem.ItemType itemType = CombinedHistoryItem.ItemType.viewTypeToItemType(viewType);
 
         switch (itemType) {
@@ -111,28 +103,48 @@ public class CombinedHistoryAdapter exte
         final int localPosition = transformAdapterPositionForDataStructure(itemType, position);
 
         switch (itemType) {
             case SYNCED_DEVICES:
                 ((CombinedHistoryItem.SmartFolder) viewHolder).bind(R.drawable.cloud, R.string.home_synced_devices_smartfolder, R.string.home_synced_devices_number, deviceCount);
                 break;
 
             case SECTION_HEADER:
-                ((TextView) viewHolder.itemView).setText(CombinedHistoryPanel.getSectionHeaderTitle(sectionHeaders.get(localPosition)));
+                ((TextView) viewHolder.itemView).setText(getSectionHeaderTitle(sectionHeaders.get(localPosition)));
                 break;
 
             case HISTORY:
                 if (historyCursor == null || !historyCursor.moveToPosition(localPosition)) {
                     throw new IllegalStateException("Couldn't move cursor to position " + localPosition);
                 }
                 ((CombinedHistoryItem.HistoryItem) viewHolder).bind(historyCursor);
                 break;
         }
     }
 
+    /**
+     * Transform an adapter position to the position for the data structure backing the item type.
+     *
+     * The type is not strictly necessary and could be fetched from <code>getItemTypeForPosition</code>,
+     * but is used for explicitness.
+     *
+     * @param type ItemType of the item
+     * @param position position in the adapter
+     * @return position of the item in the data structure
+     */
+    private int transformAdapterPositionForDataStructure(CombinedHistoryItem.ItemType type, int position) {
+        if (type == CombinedHistoryItem.ItemType.SECTION_HEADER) {
+            return position;
+        } else if (type == CombinedHistoryItem.ItemType.HISTORY){
+            return position - getHeadersBefore(position) - CombinedHistoryPanel.NUM_SMART_FOLDERS;
+        } else {
+            return position;
+        }
+    }
+
     private CombinedHistoryItem.ItemType getItemTypeForPosition(int position) {
         if (position == SYNCED_DEVICES_SMARTFOLDER_INDEX) {
             return CombinedHistoryItem.ItemType.SYNCED_DEVICES;
         }
         final int sectionPosition = transformAdapterPositionForDataStructure(CombinedHistoryItem.ItemType.SECTION_HEADER, position);
         if (sectionHeaders.get(sectionPosition) != null) {
             return CombinedHistoryItem.ItemType.SECTION_HEADER;
         }
@@ -163,37 +175,75 @@ public class CombinedHistoryAdapter exte
             return;
         }
 
         SectionHeader section = null;
 
         do {
             final int historyPosition = c.getPosition();
             final long visitTime = c.getLong(c.getColumnIndexOrThrow(BrowserContract.History.DATE_LAST_VISITED));
-            final SectionHeader itemSection = CombinedHistoryPanel.getSectionFromTime(visitTime);
+            final SectionHeader itemSection = getSectionFromTime(visitTime);
 
             if (section != itemSection) {
                 section = itemSection;
                 sparseArray.append(historyPosition + sparseArray.size() + CombinedHistoryPanel.NUM_SMART_FOLDERS, section);
             }
 
             if (section == SectionHeader.OLDER_THAN_SIX_MONTHS) {
                 break;
             }
         } while (c.moveToNext());
     }
 
+    private static String getSectionHeaderTitle(SectionHeader section) {
+        return sectionDateRangeArray[section.ordinal()].displayName;
+    }
+
+    private static SectionHeader getSectionFromTime(long time) {
+        for (int i = 0; i < SectionHeader.OLDER_THAN_SIX_MONTHS.ordinal(); i++) {
+            if (time > sectionDateRangeArray[i].start) {
+                return SectionHeader.values()[i];
+            }
+        }
+
+        return SectionHeader.OLDER_THAN_SIX_MONTHS;
+    }
+
     /**
      * Returns the number of section headers before the given history item at the adapter position.
      * @param position position in the adapter
      */
     private int getHeadersBefore(int position) {
         // Skip the first header case because there will always be a header.
         for (int i = 1; i < sectionHeaders.size(); i++) {
             // If the position of the header is greater than the history position,
             // return the number of headers tested.
             if (sectionHeaders.keyAt(i) > position) {
                 return i;
             }
         }
         return sectionHeaders.size();
     }
+
+    @Override
+    public HomeContextMenuInfo makeContextMenuInfoFromPosition(View view, int position) {
+        HomeContextMenuInfo info = new HomeContextMenuInfo(view, position, -1);
+        historyCursor.moveToPosition(transformAdapterPositionForDataStructure(CombinedHistoryItem.ItemType.HISTORY, position));
+        return populateHistoryInfoFromCursor(info, historyCursor);
+    }
+
+    protected static HomeContextMenuInfo populateHistoryInfoFromCursor(HomeContextMenuInfo info, Cursor cursor) {
+        info.url = cursor.getString(cursor.getColumnIndexOrThrow(BrowserContract.Combined.URL));
+        info.title = cursor.getString(cursor.getColumnIndexOrThrow(BrowserContract.Combined.TITLE));
+        info.historyId = cursor.getInt(cursor.getColumnIndexOrThrow(BrowserContract.Combined.HISTORY_ID));
+        info.itemType = HomeContextMenuInfo.RemoveItemType.HISTORY;
+        final int bookmarkIdCol = cursor.getColumnIndexOrThrow(BrowserContract.Combined.BOOKMARK_ID);
+        if (cursor.isNull(bookmarkIdCol)) {
+            // If this is a combined cursor, we may get a history item without a
+            // bookmark, in which case the bookmarks ID column value will be null.
+            info.bookmarkId =  -1;
+        } else {
+            info.bookmarkId = cursor.getInt(bookmarkIdCol);
+        }
+        return info;
+    }
+
 }
--- a/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryPanel.java
@@ -36,50 +36,30 @@ import org.json.JSONObject;
 import org.mozilla.gecko.EventDispatcher;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.GeckoProfile;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.RemoteClientsDialogFragment;
 import org.mozilla.gecko.restrictions.Restrictions;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
-import org.mozilla.gecko.db.BrowserContract;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.db.RemoteClient;
-import org.mozilla.gecko.db.RemoteTab;
-import org.mozilla.gecko.home.HistorySectionsHelper.SectionDateRange;
 import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.widget.DividerItemDecoration;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
 public class CombinedHistoryPanel extends HomeFragment implements RemoteClientsDialogFragment.RemoteClientsListener {
     private static final String LOGTAG = "GeckoCombinedHistoryPnl";
     private final int LOADER_ID_HISTORY = 0;
     private final int LOADER_ID_REMOTE = 1;
 
-    // Semantic names for the time covered by each section
-    public enum SectionHeader {
-        TODAY,
-        YESTERDAY,
-        WEEK,
-        THIS_MONTH,
-        MONTH_AGO,
-        TWO_MONTHS_AGO,
-        THREE_MONTHS_AGO,
-        FOUR_MONTHS_AGO,
-        FIVE_MONTHS_AGO,
-        OLDER_THAN_SIX_MONTHS
-    }
-
-    // Array for the time ranges in milliseconds covered by each section.
-    private static final SectionDateRange[] sectionDateRangeArray = new SectionDateRange[SectionHeader.values().length];
-
     // String placeholders to mark formatting.
     private final static String FORMAT_S1 = "%1$s";
     private final static String FORMAT_S2 = "%2$s";
 
     // Number of smart folders for determining practical empty state.
     public static final int NUM_SMART_FOLDERS = 1;
 
     private CombinedHistoryRecyclerView mRecyclerView;
@@ -105,42 +85,45 @@ public class CombinedHistoryPanel extend
          */
         boolean changeLevel(PanelLevel level);
     }
 
     @Override
     public void onCreate(Bundle savedInstance) {
         super.onCreate(savedInstance);
 
-        mHistoryAdapter = new CombinedHistoryAdapter();
+        mHistoryAdapter = new CombinedHistoryAdapter(getResources());
         mClientsAdapter = new ClientsAdapter(getContext());
     }
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         return inflater.inflate(R.layout.home_combined_history_panel, container, false);
     }
 
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
 
-        // TODO: Move RecyclerView boilerplate into method?
         mRecyclerView = (CombinedHistoryRecyclerView) view.findViewById(R.id.combined_recycler_view);
+        setUpRecyclerView();
+
+        mPanelFooterButton = (Button) view.findViewById(R.id.clear_history_button);
+        mPanelFooterButton.setOnClickListener(new OnFooterButtonClickListener());
+    }
+
+    private void setUpRecyclerView() {
         mRecyclerView.setAdapter(mHistoryAdapter);
 
         mRecyclerView.setItemAnimator(new DefaultItemAnimator());
         mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext()));
         mRecyclerView.setOnHistoryClickedListener(mUrlOpenListener);
         mRecyclerView.setOnPanelLevelChangeListener(new OnLevelChangeListener());
         mRecyclerView.setHiddenClientsDialogBuilder(new HiddenClientsHelper());
         registerForContextMenu(mRecyclerView);
-
-        mPanelFooterButton = (Button) view.findViewById(R.id.clear_history_button);
-        mPanelFooterButton.setOnClickListener(new OnFooterButtonClickListener());
     }
 
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
         mCursorLoaderCallbacks = new CursorLoaderCallbacks();
     }
 
@@ -177,35 +160,20 @@ public class CombinedHistoryPanel extend
         public HistoryCursorLoader(Context context) {
             super(context);
             mDB = GeckoProfile.get(context).getDB();
         }
 
         @Override
         public Cursor loadCursor() {
             final ContentResolver cr = getContext().getContentResolver();
-            HistorySectionsHelper.updateRecentSectionOffset(getContext().getResources(), sectionDateRangeArray);
             return mDB.getRecentHistory(cr, HISTORY_LIMIT);
         }
     }
 
-    protected static String getSectionHeaderTitle(SectionHeader section) {
-        return sectionDateRangeArray[section.ordinal()].displayName;
-    }
-
-    protected static SectionHeader getSectionFromTime(long time) {
-        for (int i = 0; i < SectionHeader.OLDER_THAN_SIX_MONTHS.ordinal(); i++) {
-            if (time > sectionDateRangeArray[i].start) {
-                return SectionHeader.values()[i];
-            }
-        }
-
-        return SectionHeader.OLDER_THAN_SIX_MONTHS;
-    }
-
     private class CursorLoaderCallbacks implements LoaderManager.LoaderCallbacks<Cursor> {
         private BrowserDB mDB;    // Pseudo-final: set in onCreateLoader.
 
         @Override
         public Loader<Cursor> onCreateLoader(int id, Bundle args) {
             if (mDB == null) {
                 mDB = GeckoProfile.get(getActivity()).getDB();
             }
@@ -489,31 +457,9 @@ public class CombinedHistoryPanel extend
     protected static class RemoteTabsClientContextMenuInfo extends HomeContextMenuInfo {
         protected final RemoteClient client;
 
         public RemoteTabsClientContextMenuInfo(View targetView, int position, long id, RemoteClient client) {
             super(targetView, position, id);
             this.client = client;
         }
     }
-
-    protected static HomeContextMenuInfo populateHistoryInfoFromCursor(HomeContextMenuInfo info, Cursor cursor) {
-        info.url = cursor.getString(cursor.getColumnIndexOrThrow(BrowserContract.Combined.URL));
-        info.title = cursor.getString(cursor.getColumnIndexOrThrow(BrowserContract.Combined.TITLE));
-        info.historyId = cursor.getInt(cursor.getColumnIndexOrThrow(BrowserContract.Combined.HISTORY_ID));
-        info.itemType = HomeContextMenuInfo.RemoveItemType.HISTORY;
-        final int bookmarkIdCol = cursor.getColumnIndexOrThrow(BrowserContract.Combined.BOOKMARK_ID);
-        if (cursor.isNull(bookmarkIdCol)) {
-            // If this is a combined cursor, we may get a history item without a
-            // bookmark, in which case the bookmarks ID column value will be null.
-            info.bookmarkId =  -1;
-        } else {
-            info.bookmarkId = cursor.getInt(bookmarkIdCol);
-        }
-        return info;
-    }
-
-    protected static HomeContextMenuInfo populateChildInfoFromTab(HomeContextMenuInfo info, RemoteTab tab) {
-        info.url = tab.url;
-        info.title = tab.title;
-        return info;
-    }
 }
--- a/mobile/android/base/java/org/mozilla/gecko/home/HistorySectionsHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/HistorySectionsHelper.java
@@ -2,22 +2,23 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.home;
 
 import android.content.res.Resources;
 
-import org.mozilla.gecko.home.CombinedHistoryPanel.SectionHeader;
+import org.mozilla.gecko.home.CombinedHistoryAdapter.SectionHeader;
 import org.mozilla.gecko.R;
 
 import java.util.Calendar;
 import java.util.Locale;
 
+
 public class HistorySectionsHelper {
 
     // Constants for different time sections.
     private static final long MS_PER_DAY = 86400000;
     private static final long MS_PER_WEEK = MS_PER_DAY * 7;
 
     public static class SectionDateRange {
         public final long start;