Bug 996850 - Part 1: Don't show context menu for empty sites. r=lucasr

This commit is contained in:
Chenxia Liu 2014-04-22 11:09:44 -07:00
Родитель 0783da2ec6
Коммит cf76b4008d
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -107,6 +107,13 @@ public class TopSitesGridItemView extends RelativeLayout {
return mIsPinned;
}
/**
* @return true, if this view has no content to show.
*/
public boolean isEmpty() {
return mIsEmpty;
}
/**
* @param title The title for this view.
*/

Просмотреть файл

@ -125,7 +125,8 @@ public class TopSitesGridView extends GridView {
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
Cursor cursor = (Cursor) parent.getItemAtPosition(position);
if (cursor == null) {
TopSitesGridItemView gridView = (TopSitesGridItemView) view;
if (cursor == null || gridView.isEmpty()) {
mContextMenuInfo = null;
return false;
}