https://bugs.webkit.org/show_bug.cgi?id=90067
Patch by Christophe Dumez <christophe.dumez@intel.com> 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:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121733
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-03 Christophe Dumez <christophe.dumez@intel.com>
+
+ [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 <christophe.dumez@intel.com>
[EFL][WK2] Add API to inspect a Web Intent service
return ewkIntent;
}
+
+WKIntentDataRef ewk_intent_WKIntentDataRef_get(const Ewk_Intent* intent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
+ return intent->wkIntent.get();
+}
#endif
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)
#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>
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);
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 {
*/
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