Never apply the new page policy if we already have the BWebView. If we already

have it, it was created by the ChromeClient and navigation is soon going to
happen with it.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@460 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi 2010-04-24 00:46:24 +00:00 committed by Alexandre Deckner
parent 3cba4f1616
commit a0fcf3c05e

View File

@ -743,8 +743,9 @@ BrowserWindow::MenusBeginning()
void
BrowserWindow::CreateNewTab(const BString& _url, bool select, BWebView* webView)
{
bool applyNewPagePolicy = webView == NULL;
// Executed in app thread (new BWebPage needs to be created in app thread).
if (!webView)
if (webView == NULL)
webView = new BWebView("web view");
bool isNewWindow = fTabManager->CountTabs() == 0;
@ -752,7 +753,7 @@ BrowserWindow::CreateNewTab(const BString& _url, bool select, BWebView* webView)
fTabManager->AddTab(webView, "New tab");
BString url(_url);
if (url.Length() == 0) {
if (applyNewPagePolicy && url.Length() == 0) {
uint32 policy = isNewWindow ? fNewWindowPolicy : fNewTabPolicy;
// Implement new page policy
switch (policy) {