diff options
author | Arham Jamal <arhamjamal@gmail.com> | 2012-04-26 01:54:01 -0400 |
---|---|---|
committer | Arham Jamal <arhamjamal@gmail.com> | 2012-07-24 23:20:57 +0530 |
commit | a232640f6d79f349cead379bb2c851994acb63bb (patch) | |
tree | 7eed322294ca9e010f2b63407e7b0a5ebd1a882e /src/com/android/browser/PhoneUi.java | |
parent | b1fd1ebb1877d4897415950c056658bf7071a349 (diff) | |
download | packages_apps_browser-a232640f6d79f349cead379bb2c851994acb63bb.zip packages_apps_browser-a232640f6d79f349cead379bb2c851994acb63bb.tar.gz packages_apps_browser-a232640f6d79f349cead379bb2c851994acb63bb.tar.bz2 |
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.
Credits: Afzal Najam
Signed-off-by: Arham Jamal <arhamjamal@gmail.com>
Change-Id: I5af00f1c19043104987375f1da396eb6fefb5dd4
Diffstat (limited to 'src/com/android/browser/PhoneUi.java')
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index eb6032d..e3c22bd 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -182,6 +182,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); |