Bug 1377286 - Pre: firm up access levels in HomeContextMenuInfo r=sebastian draft
authorGrigory Kruglov <gkruglov@mozilla.com>
Wed, 12 Jul 2017 17:49:43 -0400
changeset 607804 61b8b6c7cb908826835286fac061762d60d2198e
parent 607669 03bcd6d65af62c5e60a0ab9247ccce43885e707b
child 607805 4eefb81224c1cc00ba2eb6147e26119af647d317
push id68119
push userbmo:gkruglov@mozilla.com
push dateWed, 12 Jul 2017 21:59:25 +0000
reviewerssebastian
bugs1377286
milestone56.0a1
Bug 1377286 - Pre: firm up access levels in HomeContextMenuInfo r=sebastian No functional change, simply tightening things up. MozReview-Commit-ID: 43iHr29NyIx
mobile/android/base/java/org/mozilla/gecko/home/HomeContextMenuInfo.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/HomeContextMenuInfo.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/HomeContextMenuInfo.java
@@ -17,66 +17,66 @@ import android.widget.ListAdapter;
 
 /**
  * A ContextMenuInfo for HomeListView
  */
 public class HomeContextMenuInfo extends AdapterContextMenuInfo {
 
     public String url;
     public String title;
-    public boolean isFolder;
-    public int historyId = -1;
+    /* package-private */ boolean isFolder;
+    /* package-private */ int historyId = -1;
     public int bookmarkId = -1;
     public RemoveItemType itemType = null;
 
     // Item type to be handled with "Remove" selection.
-    public static enum RemoveItemType {
+    /* package-private */ enum RemoveItemType {
         BOOKMARKS, COMBINED, HISTORY
     }
 
     public HomeContextMenuInfo(View targetView, int position, long id) {
         super(targetView, position, id);
     }
 
-    public boolean hasBookmarkId() {
-        return bookmarkId > -1;
-    }
-
-    public boolean hasHistoryId() {
-        return historyId > -1;
-    }
-
-    public boolean hasPartnerBookmarkId() {
-        return bookmarkId <= BrowserContract.Bookmarks.FAKE_PARTNER_BOOKMARKS_START;
-    }
-
-    public boolean canRemove() {
-        return hasBookmarkId() || hasHistoryId() || hasPartnerBookmarkId();
-    }
-
     public String getDisplayTitle() {
         if (!TextUtils.isEmpty(title)) {
             return title;
         }
         return StringUtils.stripCommonSubdomains(StringUtils.stripScheme(url, StringUtils.UrlFlags.STRIP_HTTPS));
     }
 
+    /* package-private */ boolean hasBookmarkId() {
+        return bookmarkId > -1;
+    }
+
+    /* package-private */ boolean hasPartnerBookmarkId() {
+        return bookmarkId <= BrowserContract.Bookmarks.FAKE_PARTNER_BOOKMARKS_START;
+    }
+
+    /* package-private */ boolean canRemove() {
+        return hasBookmarkId() || hasHistoryId() || hasPartnerBookmarkId();
+    }
+
+    private boolean hasHistoryId() {
+        return historyId > -1;
+    }
+
     /**
      * Interface for creating ContextMenuInfo instances from cursors.
      */
     public interface Factory {
-        public HomeContextMenuInfo makeInfoForCursor(View view, int position, long id, Cursor cursor);
+        HomeContextMenuInfo makeInfoForCursor(View view, int position, long id, Cursor cursor);
     }
 
     /**
      * Interface for creating ContextMenuInfo instances from ListAdapters.
      */
-    public interface ListFactory extends Factory {
-        public HomeContextMenuInfo makeInfoForAdapter(View view, int position, long id, ListAdapter adapter);
+    /* package-private */ interface ListFactory extends Factory {
+        HomeContextMenuInfo makeInfoForAdapter(View view, int position, long id, ListAdapter adapter);
     }
 
     /**
      * Interface for creating ContextMenuInfo instances from ExpandableListAdapters.
      */
-    public interface ExpandableFactory {
-        public HomeContextMenuInfo makeInfoForAdapter(View view, int position, long id, ExpandableListAdapter adapter);
+    /* package-private */ interface ExpandableFactory {
+        HomeContextMenuInfo makeInfoForAdapter(View view, int position, long id, ExpandableListAdapter adapter);
     }
 }