Properly set the download listener on new tabs. This fixes the Downloads window

not popping up for subsequent tabs.


git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@192 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi
2010-02-24 10:34:53 +00:00
parent 57b6a0fc1b
commit d54c477ad1
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -94,6 +94,7 @@ LauncherWindow::LauncherWindow(BRect frame, const BMessenger& downloadListener,
: WebViewWindow(frame, "HaikuLauncher",
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS)
, m_downloadListener(downloadListener)
{
m_tabView = new WebTabView("tabview", BMessenger(this));
m_tabView->setTarget(BMessenger(this));
@@ -228,7 +229,6 @@ LauncherWindow::LauncherWindow(BRect frame, const BMessenger& downloadListener,
}
newTab("", true);
currentWebView()->WebPage()->SetDownloadListener(downloadListener);
m_findGroup->SetVisible(false);
@@ -410,6 +410,8 @@ void LauncherWindow::newTab(const BString& url, bool select)
{
// Executed in app thread (new BWebPage needs to be created in app thread).
BWebView* webView = new BWebView("web_view");
webView->WebPage()->SetDownloadListener(m_downloadListener);
m_tabView->AddTab(webView);
m_tabView->TabAt(m_tabView->CountTabs() - 1)->SetLabel("New tab");
// TODO: Remove when BTabView is fixed...
+2
View File
@@ -31,6 +31,7 @@
#define LauncherWindow_h
#include "WebViewWindow.h"
#include <Messenger.h>
#include <String.h>
class BButton;
@@ -92,6 +93,7 @@ private:
void updateTitle(const BString &title);
private:
BMessenger m_downloadListener;
BMenuBar* m_menuBar;
BMenu* m_goMenu;
IconButton* m_BackButton;