Bug 1377286 - Pre: firm up access levels in HomeContextMenuInfo r=sebastian
No functional change, simply tightening things up.
MozReview-Commit-ID: 43iHr29NyIx
--- 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);
}
}