Merge change 23445 into eclair

* changes:
  When removing a tab, go back to the correct parent tab.
diff --git a/src/com/android/browser/TitleBarSet.java b/src/com/android/browser/TitleBarSet.java
index 4bd3fd8..873f40b 100644
--- a/src/com/android/browser/TitleBarSet.java
+++ b/src/com/android/browser/TitleBarSet.java
@@ -181,10 +181,12 @@
      * Remove the tab at the given position.
      */
     /* package */ void removeTab(int position) {
+        int selection = getSelectedItemPosition();
         mTitleBars.remove(position);
         mCount--;
         // Need to refresh our list
         setAdapter(mTitleAdapter);
+        setCurrentTab(selection);
     }
 
     /**
@@ -206,6 +208,7 @@
      * Change to the tab at the new position.
      */
     /* package */ void setCurrentTab(int position) {
+        if (position < 0 || position >= mCount) return;
         mIgnoreSelectedListener = true;
         setSelection(position);
         mIgnoreSelectedListener = false;