Title: [121733] trunk/Source/WebKit2
Revision
121733
Author
[email protected]
Date
2012-07-02 23:54:42 -0700 (Mon, 02 Jul 2012)

Log Message

[EFL][WK2] Add API to deliver a Web Intent to a frame
https://bugs.webkit.org/show_bug.cgi?id=90067

Patch by Christophe Dumez <[email protected]> on 2012-07-03
Reviewed by Kenneth Rohde Christiansen.

Add ewk_view_intent_deliver() method on the Ewk_View
to deliver a Web Intent to the view's main frame.

* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_intent_deliver):
* UIProcess/API/efl/ewk_view.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (121732 => 121733)


--- trunk/Source/WebKit2/ChangeLog	2012-07-03 06:27:10 UTC (rev 121732)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-03 06:54:42 UTC (rev 121733)
@@ -1,3 +1,17 @@
+2012-07-03  Christophe Dumez  <[email protected]>
+
+        [EFL][WK2] Add API to deliver a Web Intent to a frame
+        https://bugs.webkit.org/show_bug.cgi?id=90067
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add ewk_view_intent_deliver() method on the Ewk_View
+        to deliver a Web Intent to the view's main frame.
+
+        * UIProcess/API/efl/ewk_view.cpp:
+        (ewk_view_intent_deliver):
+        * UIProcess/API/efl/ewk_view.h:
+
 2012-07-02  Christophe Dumez  <[email protected]>
 
         [EFL][WK2] Add API to inspect a Web Intent service

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp (121732 => 121733)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp	2012-07-03 06:27:10 UTC (rev 121732)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp	2012-07-03 06:54:42 UTC (rev 121733)
@@ -198,4 +198,10 @@
 
     return ewkIntent;
 }
+
+WKIntentDataRef ewk_intent_WKIntentDataRef_get(const Ewk_Intent* intent)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
+    return intent->wkIntent.get();
+}
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h (121732 => 121733)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h	2012-07-03 06:27:10 UTC (rev 121732)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h	2012-07-03 06:54:42 UTC (rev 121733)
@@ -33,6 +33,7 @@
 typedef struct _Ewk_Intent Ewk_Intent;
 
 Ewk_Intent* ewk_intent_new(WKIntentDataRef intentData);
+WKIntentDataRef ewk_intent_WKIntentDataRef_get(const Ewk_Intent* intent);
 
 #endif // ENABLE(WEB_INTENTS)
 

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (121732 => 121733)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-07-03 06:27:10 UTC (rev 121732)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-07-03 06:54:42 UTC (rev 121733)
@@ -30,6 +30,7 @@
 #include "WKURL.h"
 #include "ewk_context.h"
 #include "ewk_context_private.h"
+#include "ewk_intent_private.h"
 #include "ewk_view_loader_client_private.h"
 #include "ewk_view_private.h"
 #include <wtf/text/CString.h>
@@ -616,6 +617,21 @@
     return false;
 }
 
+Eina_Bool ewk_view_intent_deliver(Evas_Object* ewkView, Ewk_Intent* intent)
+{
+#if ENABLE(WEB_INTENTS)
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(intent, false);
+
+    WKPageRef wkPage = toAPI(priv->pageClient->page());
+    WKPageDeliverIntentToFrame(wkPage, WKPageGetMainFrame(wkPage), ewk_intent_WKIntentDataRef_get(intent));
+    return true;
+#else
+    return false;
+#endif
+}
+
 Eina_Bool ewk_view_back_possible(Evas_Object* ewkView)
 {
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h (121732 => 121733)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h	2012-07-03 06:27:10 UTC (rev 121732)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h	2012-07-03 06:54:42 UTC (rev 121733)
@@ -43,6 +43,7 @@
 
 typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data;
 typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class;
+typedef struct _Ewk_Intent Ewk_Intent;
 
 /// Ewk view's class, to be overridden by sub-classes.
 struct _Ewk_View_Smart_Class {
@@ -191,7 +192,16 @@
  */
 EAPI Eina_Bool    ewk_view_stop(Evas_Object *o);
 
-/*
+/**
+ * Delivers a Web intent to the view's main frame.
+ *
+ * @param o view object to deliver the intent to
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
+ */
+EAPI Eina_Bool    ewk_view_intent_deliver(Evas_Object *o, Ewk_Intent *intent);
+
+/**
  * Asks the main frame to navigate back in the history.
  *
  * @param o view object to navigate back
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to