[WK2] Move intent delivery code from the frame to the page
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 21:43:31 +0000 (21:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 21:43:31 +0000 (21:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89974

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-06-29
Reviewed by Anders Carlsson.

Move the intent delivery code from the frame to the page
and add the corresponding C API for WKPage.

* UIProcess/API/C/WKPage.cpp:
(WKPageDeliverIntentToFrame):
* UIProcess/API/C/WKPage.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::stopLoading):
* UIProcess/WebFrameProxy.h:
(WebKit):
* UIProcess/WebPageProxy.cpp:
(WebKit):
(WebKit::WebPageProxy::deliverIntentToFrame):
* UIProcess/WebPageProxy.h:
(WebPageProxy):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/WebFrameProxy.cpp
Source/WebKit2/UIProcess/WebFrameProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h

index c2d88d4..0ae1889 100644 (file)
@@ -1,3 +1,26 @@
+2012-06-29  Christophe Dumez  <christophe.dumez@intel.com>
+
+        [WK2] Move intent delivery code from the frame to the page
+        https://bugs.webkit.org/show_bug.cgi?id=89974
+
+        Reviewed by Anders Carlsson.
+
+        Move the intent delivery code from the frame to the page
+        and add the corresponding C API for WKPage.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageDeliverIntentToFrame):
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::stopLoading):
+        * UIProcess/WebFrameProxy.h:
+        (WebKit):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit):
+        (WebKit::WebPageProxy::deliverIntentToFrame):
+        * UIProcess/WebPageProxy.h:
+        (WebPageProxy):
+
 2012-06-29  Dan Bernstein  <mitz@apple.com>
 
         Can’t get basic element info from a WKRenderObject
index c2a21b5..5c60035 100644 (file)
@@ -684,6 +684,13 @@ void WKPageEndPrinting(WKPageRef page)
 }
 #endif
 
+void WKPageDeliverIntentToFrame(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent)
+{
+#if ENABLE(WEB_INTENTS)
+    toImpl(page)->deliverIntentToFrame(toImpl(frame), toImpl(intent));
+#endif
+}
+
 WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef)
 {
     return 0;
index 035f51d..12a7b63 100644 (file)
@@ -468,6 +468,8 @@ WK_EXPORT void WKPageGetContentsAsString_b(WKPageRef page, WKPageGetContentsAsSt
 typedef void (*WKPageForceRepaintFunction)(WKErrorRef, void*);
 WK_EXPORT void WKPageForceRepaint(WKPageRef page, void* context, WKPageForceRepaintFunction function);
 
+WK_EXPORT void WKPageDeliverIntentToFrame(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent);
+
 /*
     Some of the more common command name strings include the following, although any WebCore EditorCommand string is supported:
     
index f97d85b..f60fab0 100644 (file)
 #include <stdio.h>
 #include <wtf/text/WTFString.h>
 
-#if ENABLE(WEB_INTENTS)
-#include "WebIntentData.h"
-#endif
-
 using namespace WebCore;
 using namespace std;
 
@@ -98,19 +94,6 @@ void WebFrameProxy::stopLoading() const
 
     m_page->process()->send(Messages::WebPage::StopLoadingFrame(m_frameID), m_page->pageID());
 }
-
-#if ENABLE(WEB_INTENTS)
-void WebFrameProxy::deliverIntent(WebIntentData* webIntentData)
-{
-    if (!m_page)
-        return;
-
-    if (!m_page->isValid())
-        return;
-
-    m_page->process()->send(Messages::WebPage::DeliverIntentToFrame(m_frameID, webIntentData->store()), m_page->pageID());
-}
-#endif
     
 bool WebFrameProxy::canProvideSource() const
 {
index 1f7329b..de5a58c 100644 (file)
@@ -50,10 +50,6 @@ class WebFormSubmissionListenerProxy;
 class WebFramePolicyListenerProxy;
 class WebPageProxy;
 
-#if ENABLE(WEB_INTENTS)
-class WebIntentData;
-#endif
-
 typedef GenericCallback<WKDataRef> DataCallback;
 
 class WebFrameProxy : public APIObject {
@@ -90,10 +86,6 @@ public:
     bool isFrameSet() const { return m_isFrameSet; }
 
     LoadState loadState() const { return m_loadState; }
-
-#if ENABLE(WEB_INTENTS)
-    void deliverIntent(WebIntentData*);
-#endif
     
     void stopLoading() const;
 
index b5046b2..d6039d7 100644 (file)
@@ -1631,6 +1631,16 @@ void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCall
     process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
 }
 
+#if ENABLE(WEB_INTENTS)
+void WebPageProxy::deliverIntentToFrame(WebFrameProxy* frame, WebIntentData* webIntentData)
+{
+    if (!isValid())
+        return;
+
+    process()->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);
+}
+#endif
+
 void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
 {
     RefPtr<StringCallback> callback = prpCallback;
index ed99d0d..3c1b412 100644 (file)
@@ -124,6 +124,10 @@ typedef GtkWidget* PlatformWidget;
 typedef Evas_Object* PlatformWidget;
 #endif
 
+#if ENABLE(WEB_INTENTS)
+class WebIntentData;
+#endif
+
 namespace WebKit {
 
 class NativeWebKeyboardEvent;
@@ -530,6 +534,10 @@ public:
     void runJavaScriptInMainFrame(const String&, PassRefPtr<ScriptValueCallback>);
     void forceRepaint(PassRefPtr<VoidCallback>);
 
+#if ENABLE(WEB_INTENTS)
+    void deliverIntentToFrame(WebFrameProxy*, WebIntentData*);
+#endif
+
     float headerHeight(WebFrameProxy*);
     float footerHeight(WebFrameProxy*);
     void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);