From d4e3331a3cfa368e8e26f18700ed3474a24ff553 Mon Sep 17 00:00:00 2001 From: Afzal Najam Date: Thu, 26 Apr 2012 01:54:01 -0400 Subject: Added a menu item in Browser called Close other tabs This closes all other tabs except the current one (only for the phone interface) Will submit patch for tablet interface once this is approved. It solves the problem of mass closing unneeded tabs to a certain extent. Preferred method would be to select multiple tabs like list items. Change-Id: I5af00f1c19043104987375f1da396eb6fefb5dd4 --- src/com/android/browser/PhoneUi.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/com/android/browser/PhoneUi.java') diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index 4da0668..9104095 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -214,6 +214,14 @@ public class PhoneUi extends BaseUi { if (incognito != null) { incognito.setVisible(showingNavScreen() || mUseQuickControls); } + MenuItem closeOthers = menu.findItem(R.id.close_other_tabs_id); + if (closeOthers != null) { + boolean isLastTab = true; + if (tab != null) { + isLastTab = (mTabControl.getTabCount() <= 1); + } + closeOthers.setEnabled(!isLastTab); + } if (showingNavScreen()) { menu.setGroupVisible(R.id.LIVE_MENU, false); menu.setGroupVisible(R.id.SNAPSHOT_MENU, false); -- cgit v1.1