wxWebKit API changes in preparation for DRT implementation.
[WebKit.git] / WebKit / wx / WebKitSupport / ChromeClientWx.cpp
index e858a1ec48afd7621026e198eb5e350f88d0483b..cf036dea47f184c3caddff88f53df8b7f5236e6d 100644 (file)
 
 namespace WebCore {
 
 
 namespace WebCore {
 
+ChromeClientWx::ChromeClientWx(wxWebView* webView)
+{
+    m_webView = webView;
+}
+
 ChromeClientWx::~ChromeClientWx()
 {
 }
 ChromeClientWx::~ChromeClientWx()
 {
 }
@@ -192,11 +197,17 @@ void ChromeClientWx::setResizable(bool)
     notImplemented();
 }
 
     notImplemented();
 }
 
-void ChromeClientWx::addMessageToConsole(const String&,
-                                          unsigned int,
-                                          const String&)
+void ChromeClientWx::addMessageToConsole(const String& message,
+                                          unsigned int lineNumber,
+                                          const String& sourceID)
 {
 {
-    notImplemented();
+    if (m_webView) {
+        wxWebViewConsoleMessageEvent wkEvent(m_webView);
+        wkEvent.SetMessage(message);
+        wkEvent.SetLineNumber(lineNumber);
+        wkEvent.SetSourceID(sourceID);
+        m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+    }
 }
 
 bool ChromeClientWx::canRunBeforeUnloadConfirmPanel()
 }
 
 bool ChromeClientWx::canRunBeforeUnloadConfirmPanel()