diff --git a/src/apps/webpositive/LauncherWindow.cpp b/src/apps/webpositive/LauncherWindow.cpp index 7752ac0eb3..4f0dcc143a 100644 --- a/src/apps/webpositive/LauncherWindow.cpp +++ b/src/apps/webpositive/LauncherWindow.cpp @@ -416,10 +416,11 @@ void LauncherWindow::MenusBeginning() history->Unlock(); } -void LauncherWindow::newTab(const BString& url, bool select) +void LauncherWindow::newTab(const BString& url, bool select, BWebView* webView) { // Executed in app thread (new BWebPage needs to be created in app thread). - BWebView* webView = new BWebView("web_view"); + if (!webView) + webView = new BWebView("web view"); webView->WebPage()->SetDownloadListener(m_downloadListener); m_tabView->AddTab(webView); @@ -459,6 +460,11 @@ void LauncherWindow::NewWindowRequested(const BString& url, bool primaryAction) be_app->PostMessage(&message); } +void LauncherWindow::NewPageCreated(BWebView* view) +{ + newTab(BString(), true, view); +} + void LauncherWindow::LoadNegotiating(const BString& url, BWebView* view) { BString status("Requesting: "); diff --git a/src/apps/webpositive/LauncherWindow.h b/src/apps/webpositive/LauncherWindow.h index ba7b611bc2..97b28f1123 100644 --- a/src/apps/webpositive/LauncherWindow.h +++ b/src/apps/webpositive/LauncherWindow.h @@ -68,12 +68,13 @@ public: virtual bool QuitRequested(); virtual void MenusBeginning(); - void newTab(const BString& url, bool select); + void newTab(const BString& url, bool select, BWebView* webView = 0); private: // WebPage notification API implementations virtual void NavigationRequested(const BString& url, BWebView* view); virtual void NewWindowRequested(const BString& url, bool primaryAction); + virtual void NewPageCreated(BWebView* view); virtual void LoadNegotiating(const BString& url, BWebView* view); virtual void LoadCommitted(const BString& url, BWebView* view); virtual void LoadProgress(float progress, BWebView* view);