зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1553474 - "Remove bookmark" option is displayed for pages that were not bookmarked; r=petru
Differential Revision: https://phabricator.services.mozilla.com/D32664 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
7fe82142c4
Коммит
15ff313e56
|
@ -126,7 +126,7 @@ public class TopPanelRow extends StreamViewHolder {
|
|||
if (isPinned || !urls.contains(baseUrl)) {
|
||||
final Object[] originalColumns = new Object[] {
|
||||
cursor.getLong(cursor.getColumnIndex(BrowserContract.Combined._ID)),
|
||||
cursor.getLong(cursor.getColumnIndex(BrowserContract.Combined.BOOKMARK_ID)),
|
||||
getBookmarkId(cursor),
|
||||
cursor.getLong(cursor.getColumnIndex(BrowserContract.Combined.HISTORY_ID)),
|
||||
cursor.getString(cursor.getColumnIndex(BrowserContract.Combined.URL)),
|
||||
cursor.getString(cursor.getColumnIndex(BrowserContract.Combined.TITLE)),
|
||||
|
@ -143,6 +143,12 @@ public class TopPanelRow extends StreamViewHolder {
|
|||
return filteredCursor;
|
||||
}
|
||||
|
||||
private Long getBookmarkId(Cursor cursor) {
|
||||
// If the value of BOOKMARK_ID column it's null that means the url is not bookmarked
|
||||
final int columnIndex = cursor.getColumnIndex(BrowserContract.Combined.BOOKMARK_ID);
|
||||
return cursor.isNull(columnIndex) ? null : cursor.getLong(columnIndex);
|
||||
}
|
||||
|
||||
private boolean isTopSitePinned(final int topSiteType) {
|
||||
return topSiteType == BrowserContract.TopSites.TYPE_PINNED;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче