diff options
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r-- | src/com/android/browser/Controller.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 8238d77..a53e344 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1546,6 +1546,10 @@ public class Controller openIncognitoTab(); break; + case R.id.close_other_tabs_id: + closeOtherTabs(); + break; + case R.id.goto_menu_id: editUrl(); break; @@ -2419,6 +2423,20 @@ public class Controller } } + /** + * Close all tabs except the current one + */ + @Override + public void closeOtherTabs() { + int inactiveTabs = mTabControl.getTabCount() - 1; + for (int i = inactiveTabs; i >= 0; i--) { + Tab tab = mTabControl.getTab(i); + if (tab != mTabControl.getCurrentTab()) { + removeTab(tab); + } + } + } + // Called when loading from context menu or LOAD_URL message protected void loadUrlFromContext(String url) { Tab tab = getCurrentTab(); |