fix close last page bug

    Bug: 4586081
    changed behavior of closing last page to exit the browser
    (consistent with tablet UI)
    this eliminates the state where browser doesn't have a current
    page which caused the original bug

Change-Id: If933c6f14b6ae0c5c95fc8e656bbd909f6cb09b7
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java
index 6ef759f..eeca95a 100644
--- a/src/com/android/browser/NavScreen.java
+++ b/src/com/android/browser/NavScreen.java
@@ -169,16 +169,12 @@
 
     private void onCloseTab(Tab tab) {
         if (tab != null) {
-            mUiController.closeTab(tab);
-            if (mUiController.getTabControl().getTabCount() == 0) {
-                openNewTab();
-            } else {
-                mAdapter.notifyDataSetChanged();
-            }
+            switchToSelected();
+            mUiController.closeCurrentTab();
+            mAdapter.notifyDataSetChanged();
         }
     }
 
-
     private void openNewTab() {
         // need to call openTab explicitely with setactive false
         Tab tab = mUiController.openTab(BrowserSettings.getInstance().getHomePage(),