Fix popup crash

Allow new window till allowed max active tabs. Remove
confirmation dialog to display to the user when pop-up setting
is blocked from the settings menu as now we are using chromium
infobar for the same purpose.

Change-Id: I5233efafe5395d87094355bf7ff9d7490352c1ee
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index a1a3aba..7ea2955 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -857,7 +857,9 @@
 
             // Short-circuit if this was a user gesture.
             if (userGesture || !mSettings.blockPopupWindows()) {
-                CreateWindowParams windowParams = view.getCreateWindowParams();
+                WebView.WebViewTransport transport =
+                        (WebView.WebViewTransport) resultMsg.obj;
+                CreateWindowParams windowParams = transport.getCreateWindowParams();
                 if (windowParams.mOpenerSuppressed) {
                     createWindow(dialog, resultMsg, windowParams.mURL, true);
                     // This is special case for rendering links on a webpage in
@@ -872,35 +874,7 @@
                 return true;
             }
 
-            // Allow the popup and create the appropriate window.
-            final AlertDialog.OnClickListener allowListener =
-                    new AlertDialog.OnClickListener() {
-                        public void onClick(DialogInterface d,
-                                int which) {
-                            createWindow(dialog, resultMsg);
-                        }
-                    };
-
-            // Block the popup by returning a null WebView.
-            final AlertDialog.OnClickListener blockListener =
-                    new AlertDialog.OnClickListener() {
-                        public void onClick(DialogInterface d, int which) {
-                            resultMsg.sendToTarget();
-                        }
-                    };
-
-            // Build a confirmation dialog to display to the user.
-            final AlertDialog d =
-                    new AlertDialog.Builder(mContext)
-                    .setIconAttribute(android.R.attr.alertDialogIcon)
-                    .setMessage(R.string.popup_window_attempt)
-                    .setPositiveButton(R.string.allow, allowListener)
-                    .setNegativeButton(R.string.block, blockListener)
-                    .setCancelable(false)
-                    .create();
-
-            // Show the confirmation dialog.
-            d.show();
+            createWindow(dialog, resultMsg);
             return true;
         }