mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1196708 - Restricted profiles: Hide Remove context menu item from Top Sites. r=mhaigh
This commit is contained in:
parent
00eeeeb903
commit
3385433bf5
@ -345,13 +345,17 @@ public class TopSitesPanel extends HomeFragment {
|
||||
return;
|
||||
}
|
||||
|
||||
final Context context = view.getContext();
|
||||
|
||||
// Long pressed item was a Top Sites GridView item, handle it.
|
||||
MenuInflater inflater = new MenuInflater(view.getContext());
|
||||
MenuInflater inflater = new MenuInflater(context);
|
||||
inflater.inflate(R.menu.home_contextmenu, menu);
|
||||
|
||||
// Hide unused menu items.
|
||||
menu.findItem(R.id.home_edit_bookmark).setVisible(false);
|
||||
|
||||
menu.findItem(R.id.home_remove).setVisible(RestrictedProfiles.isAllowed(context, Restriction.DISALLOW_CLEAR_HISTORY));
|
||||
|
||||
TopSitesGridContextMenuInfo info = (TopSitesGridContextMenuInfo) menuInfo;
|
||||
menu.setHeaderTitle(info.getDisplayTitle());
|
||||
|
||||
@ -372,7 +376,7 @@ public class TopSitesPanel extends HomeFragment {
|
||||
menu.findItem(R.id.home_share).setVisible(false);
|
||||
}
|
||||
|
||||
if (!RestrictedProfiles.isAllowed(view.getContext(), Restriction.DISALLOW_PRIVATE_BROWSING)) {
|
||||
if (!RestrictedProfiles.isAllowed(context, Restriction.DISALLOW_PRIVATE_BROWSING)) {
|
||||
menu.findItem(R.id.home_open_private_tab).setVisible(false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user