Implement creating new pages properly. This fixes content submission on
haiku-os.org and probably a few other things. Basically, we were creating the new pages ourselves in dispatchDecidePolicyForNewWindowAction(), but we were meant to implement dispatchCreatePage() instead. Now, what we do is similar for the Qt port, only better (found a bug in Arora): When the user clicked with the tertiary mouse button, we create the window ourselves, as before, and otherwise always have WebCore create the page instead. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@218 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
@@ -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: ");
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user