summaryrefslogtreecommitdiffstats
path: root/WebKit/wx
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-05 14:27:46 +0000
committerSteve Block <steveblock@google.com>2010-02-15 10:49:50 +0000
commit5e2bc6953fe6923165b8a5d7679939693a1d58d6 (patch)
tree6ccb8c24bc2bf5e8f413e6cfae250b729b426631 /WebKit/wx
parent4a00f4fccc3cb7e9996749a05631f5d7b9de756e (diff)
downloadexternal_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.zip
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.gz
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.bz2
Merge webkit.org at r54340 : Initial merge by git
Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44
Diffstat (limited to 'WebKit/wx')
-rw-r--r--WebKit/wx/ChangeLog14
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.cpp41
-rw-r--r--WebKit/wx/WebView.h31
3 files changed, 72 insertions, 14 deletions
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 1c7adf2..26d14d6 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-03 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Add wxWebKitWindowFeatures and have createWindow send a notification for
+ clients to handle.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34542
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::wkFeaturesforWindowFeatures):
+ (WebCore::ChromeClientWx::createWindow):
+ * WebView.h:
+
2010-01-27 Kevin Watters <kevinwatters@gmail.com>
Reviewed by Kevin Ollivier.
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
index 17f6f43..4d524bc 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -37,6 +37,7 @@
#include "FrameLoadRequest.h"
#include "NotImplemented.h"
#include "PlatformString.h"
+#include "WindowFeatures.h"
#include <stdio.h>
@@ -53,6 +54,21 @@
namespace WebCore {
+wxWebKitWindowFeatures wkFeaturesforWindowFeatures(const WindowFeatures& features)
+{
+ wxWebKitWindowFeatures wkFeatures;
+ wkFeatures.menuBarVisible = features.menuBarVisible;
+ wkFeatures.statusBarVisible = features.statusBarVisible;
+ wkFeatures.toolBarVisible = features.toolBarVisible;
+ wkFeatures.locationBarVisible = features.locationBarVisible;
+ wkFeatures.scrollbarsVisible = features.scrollbarsVisible;
+ wkFeatures.resizable = features.resizable;
+ wkFeatures.fullscreen = features.fullscreen;
+ wkFeatures.dialog = features.dialog;
+
+ return wkFeatures;
+}
+
ChromeClientWx::ChromeClientWx(wxWebView* webView)
{
m_webView = webView;
@@ -115,22 +131,21 @@ void ChromeClientWx::focusedNodeChanged(Node*)
{
}
-Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures&)
+Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
{
-
- // FIXME: Create a EVT_WEBKIT_NEW_WINDOW event, and only run this code
- // when that event is not handled.
-
Page* myPage = 0;
- wxWebBrowserShell* newFrame = new wxWebBrowserShell(wxTheApp->GetAppName());
+ wxWebViewNewWindowEvent wkEvent(m_webView);
+ wkEvent.SetURL(request.resourceRequest().url().string());
- if (newFrame->webview) {
- newFrame->webview->LoadURL(request.resourceRequest().url().string());
- newFrame->Show(true);
-
- WebViewPrivate* impl = newFrame->webview->m_impl;
- if (impl)
- myPage = impl->page;
+ wxWebKitWindowFeatures wkFeatures = wkFeaturesforWindowFeatures(features);
+ wkEvent.SetWindowFeatures(wkFeatures);
+
+ if (m_webView->GetEventHandler()->ProcessEvent(wkEvent)) {
+ if (wxWebView* webView = wkEvent.GetWebView()) {
+ WebViewPrivate* impl = webView->m_impl;
+ if (impl)
+ myPage = impl->page;
+ }
}
return myPage;
diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h
index 7d923a3..9a6546c 100644
--- a/WebKit/wx/WebView.h
+++ b/WebKit/wx/WebView.h
@@ -203,7 +203,6 @@ public:
const wxString& password = wxEmptyString);
wxWebSettings GetWebSettings();
-
wxWebKitParseMode GetParseMode() const;
protected:
@@ -304,6 +303,30 @@ private:
wxString m_url;
};
+class WXDLLIMPEXP_WEBKIT wxWebKitWindowFeatures
+{
+public:
+ wxWebKitWindowFeatures()
+ : menuBarVisible(true)
+ , statusBarVisible(true)
+ , toolBarVisible(true)
+ , locationBarVisible(true)
+ , scrollbarsVisible(true)
+ , resizable(true)
+ , fullscreen(false)
+ , dialog(false)
+ { }
+
+ bool menuBarVisible;
+ bool statusBarVisible;
+ bool toolBarVisible;
+ bool locationBarVisible;
+ bool scrollbarsVisible;
+ bool resizable;
+ bool fullscreen;
+ bool dialog;
+};
+
class WXDLLIMPEXP_WEBKIT wxWebViewNewWindowEvent : public wxCommandEvent
{
#ifndef SWIG
@@ -315,11 +338,17 @@ public:
void SetURL(const wxString& url) { m_url = url; }
wxString GetTargetName() const { return m_targetName; }
void SetTargetName(const wxString& name) { m_targetName = name; }
+ wxWebView* GetWebView() { return m_webView; }
+ void SetWebView(wxWebView* webView) { m_webView = webView; }
+ wxWebKitWindowFeatures GetWindowFeatures() { return m_features; }
+ void SetWindowFeatures(wxWebKitWindowFeatures features) { m_features = features; }
wxWebViewNewWindowEvent( wxWindow* win = static_cast<wxWindow*>(NULL));
wxEvent *Clone(void) const { return new wxWebViewNewWindowEvent(*this); }
private:
+ wxWebView* m_webView;
+ wxWebKitWindowFeatures m_features;
wxString m_url;
wxString m_targetName;
};