[Qt][WK2] Use C API to enable Navigator Qt Object.
authormichael.bruning@digia.com <michael.bruning@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 11:48:24 +0000 (11:48 +0000)
committermichael.bruning@digia.com <michael.bruning@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 11:48:24 +0000 (11:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112810

Reviewed by Andreas Kling.

Replace the direct reference to the WebPageProxy with use of
C API.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::setNavigatorQtObjectEnabled):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148008 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp

index 9a57e43..0eaefa5 100644 (file)
@@ -1,5 +1,18 @@
 2013-04-09  Michael BrĂ¼ning  <michael.bruning@digia.com>
 
+        [Qt][WK2] Use C API to enable Navigator Qt Object.
+        https://bugs.webkit.org/show_bug.cgi?id=112810
+
+        Reviewed by Andreas Kling.
+
+        Replace the direct reference to the WebPageProxy with use of
+        C API.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::setNavigatorQtObjectEnabled):
+
+2013-04-09  Michael BrĂ¼ning  <michael.bruning@digia.com>
+
         [WK2] Add C API to copy selected files from WebOpenPanelParameters.
         https://bugs.webkit.org/show_bug.cgi?id=112339
 
index 0a4612b..f72f8d6 100644 (file)
@@ -66,6 +66,7 @@
 #include <QtCore/QFile>
 #include <QtQml/QJSValue>
 #include <QtQuick/QQuickView>
+#include <WKNumber.h>
 #include <WKOpenPanelResultListener.h>
 #include <WKPageGroup.h>
 #include <WKPreferences.h>
@@ -839,9 +840,9 @@ void QQuickWebViewPrivate::setNavigatorQtObjectEnabled(bool enabled)
     // FIXME: Currently we have to keep this information in both processes and the setting is asynchronous.
     m_navigatorQtObjectEnabled = enabled;
 
-    static String messageName("SetNavigatorQtObjectEnabled");
-    RefPtr<WebBoolean> webEnabled = WebBoolean::create(enabled);
-    webPageProxy->postMessageToInjectedBundle(messageName, webEnabled.get());
+    static WKStringRef messageName = WKStringCreateWithUTF8CString("SetNavigatorQtObjectEnabled");
+    WKRetainPtr<WKBooleanRef> wkEnabled = adoptWK(WKBooleanCreate(enabled));
+    WKPagePostMessageToInjectedBundle(webPage.get(), messageName, wkEnabled.get());
 }
 
 static WKRetainPtr<WKStringRef> readUserScript(const QUrl& url)