Merge "When a window is closed, destroy the WebView properly so that WebCore is informed of it's destruction."

This commit is contained in:
Ben Murdoch
2010-02-04 09:54:26 -08:00
committed by Android (Google) Code Review

View File

@@ -670,7 +670,12 @@ public class TestShellActivity extends Activity implements LayoutTestController
public boolean onCreateWindow(WebView view, boolean dialog,
boolean userGesture, Message resultMsg) {
if (!mCanOpenWindows) {
return false;
// We can't open windows, so just send null back.
WebView.WebViewTransport transport =
(WebView.WebViewTransport) resultMsg.obj;
transport.setWebView(null);
resultMsg.sendToTarget();
return true;
}
// We never display the new window, just create the view and
@@ -688,6 +693,11 @@ public class TestShellActivity extends Activity implements LayoutTestController
resultMsg.sendToTarget();
return true;
}
@Override
public void onCloseWindow(WebView view) {
view.destroy();
}
};
private static class NewWindowWebView extends WebView {