Fix blank page activity selection bug

 Bug: 5191031
 Sets an app id on the tab so that if the intent comes back to us,
 it is opened in the current tab.
 Close empty tabs correctly if the intent goes elsewhere
 Fix Tab.syncCurrentState to deal with WebView.getUrl() == null correctly

Change-Id: I31e1e1f6688fb5c5c31ba07dde4e6b3bad34fb13
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 92cb743..58edd23 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -2098,15 +2098,11 @@
         }
     }
 
-    protected void closeEmptyChildTab() {
+    protected void closeEmptyTab() {
         Tab current = mTabControl.getCurrentTab();
         if (current != null
                 && current.getWebView().copyBackForwardList().getSize() == 0) {
-            Tab parent = current.getParent();
-            if (parent != null) {
-                switchToTab(parent);
-                closeTab(current);
-            }
+            closeCurrentTab();
         }
     }