diff options
Diffstat (limited to 'src/com/android/browser/TabControl.java')
| -rw-r--r-- | src/com/android/browser/TabControl.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index 7055ef3bb..cd8da2ed1 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -514,6 +514,25 @@ class TabControl { return tabsToGo; } + Tab getLeastUsedTab(Tab current) { + if (getTabCount() == 1 || current == null) { + return null; + } + if (mTabQueue.size() == 0) { + return null; + } + // find a tab which is not the current tab or the parent of the + // current tab + for (Tab t : mTabQueue) { + if (t != null && t.getWebView() != null) { + if (t != current && t != current.getParent()) { + return t; + } + } + } + return null; + } + /** * Show the tab that contains the given WebView. * @param view The WebView used to find the tab. |
