Title: [121449] trunk/Source/WebKit2
Revision
121449
Author
[email protected]
Date
2012-06-28 12:20:28 -0700 (Thu, 28 Jun 2012)

Log Message

[WK2] Add C API to inspect a Web Intent service
https://bugs.webkit.org/show_bug.cgi?id=89276

Patch by Christophe Dumez <[email protected]> on 2012-06-28
Reviewed by Anders Carlsson.

Add C API for Web intent service so that it can be queried
on client side.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/API/C/WKIntentServiceInfo.cpp: Added.
(WKIntentServiceInfoGetTypeID):
(WKIntentServiceInfoCopyAction):
(WKIntentServiceInfoCopyType):
(WKIntentServiceInfoCopyHref):
(WKIntentServiceInfoCopyTitle):
(WKIntentServiceInfoCopyDisposition):
* UIProcess/API/C/WKIntentServiceInfo.h: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/CMakeLists.txt (121448 => 121449)


--- trunk/Source/WebKit2/CMakeLists.txt	2012-06-28 19:15:31 UTC (rev 121448)
+++ trunk/Source/WebKit2/CMakeLists.txt	2012-06-28 19:20:28 UTC (rev 121449)
@@ -280,6 +280,7 @@
     UIProcess/API/C/WKIconDatabase.cpp
     UIProcess/API/C/WKInspector.cpp
     UIProcess/API/C/WKIntentData.cpp
+    UIProcess/API/C/WKIntentServiceInfo.cpp
     UIProcess/API/C/WKKeyValueStorageManager.cpp
     UIProcess/API/C/WKMediaCacheManager.cpp
     UIProcess/API/C/WKNavigationData.cpp

Modified: trunk/Source/WebKit2/ChangeLog (121448 => 121449)


--- trunk/Source/WebKit2/ChangeLog	2012-06-28 19:15:31 UTC (rev 121448)
+++ trunk/Source/WebKit2/ChangeLog	2012-06-28 19:20:28 UTC (rev 121449)
@@ -1,3 +1,25 @@
+2012-06-28  Christophe Dumez  <[email protected]>
+
+        [WK2] Add C API to inspect a Web Intent service
+        https://bugs.webkit.org/show_bug.cgi?id=89276
+
+        Reviewed by Anders Carlsson.
+
+        Add C API for Web intent service so that it can be queried
+        on client side.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * UIProcess/API/C/WKIntentServiceInfo.cpp: Added.
+        (WKIntentServiceInfoGetTypeID):
+        (WKIntentServiceInfoCopyAction):
+        (WKIntentServiceInfoCopyType):
+        (WKIntentServiceInfoCopyHref):
+        (WKIntentServiceInfoCopyTitle):
+        (WKIntentServiceInfoCopyDisposition):
+        * UIProcess/API/C/WKIntentServiceInfo.h: Added.
+
 2012-06-28  Balazs Kelemen  <[email protected]>
 
         [Qt] KURL assert at fast/loader/opaque-base-url.html

Modified: trunk/Source/WebKit2/GNUmakefile.list.am (121448 => 121449)


--- trunk/Source/WebKit2/GNUmakefile.list.am	2012-06-28 19:15:31 UTC (rev 121448)
+++ trunk/Source/WebKit2/GNUmakefile.list.am	2012-06-28 19:20:28 UTC (rev 121449)
@@ -64,6 +64,7 @@
 	$(WebKit2)/UIProcess/API/C/WKHitTestResult.h \
 	$(WebKit2)/UIProcess/API/C/WKInspector.h \
 	$(WebKit2)/UIProcess/API/C/WKIntentData.h \
+	$(WebKit2)/UIProcess/API/C/WKIntentServiceInfo.h \
 	$(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \
 	$(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \
 	$(WebKit2)/UIProcess/API/C/WKNativeEvent.h \
@@ -538,6 +539,8 @@
 	Source/WebKit2/UIProcess/API/C/WKInspector.h \
 	Source/WebKit2/UIProcess/API/C/WKIntentData.cpp \
 	Source/WebKit2/UIProcess/API/C/WKIntentData.h \
+	Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.cpp \
+	Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.h \
 	Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp \
 	Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h \
 	Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp \

Modified: trunk/Source/WebKit2/Target.pri (121448 => 121449)


--- trunk/Source/WebKit2/Target.pri	2012-06-28 19:15:31 UTC (rev 121448)
+++ trunk/Source/WebKit2/Target.pri	2012-06-28 19:20:28 UTC (rev 121449)
@@ -162,6 +162,7 @@
     UIProcess/API/C/WKIconDatabase.h \
     UIProcess/API/C/WKInspector.h \
     UIProcess/API/C/WKIntentData.h \
+    UIProcess/API/C/WKIntentServiceInfo.h \
     UIProcess/API/C/WKOpenPanelParameters.h \
     UIProcess/API/C/WKOpenPanelResultListener.h \
     UIProcess/API/C/WKNavigationData.h \
@@ -521,6 +522,7 @@
     UIProcess/API/C/WKIconDatabase.cpp \
     UIProcess/API/C/WKInspector.cpp \
     UIProcess/API/C/WKIntentData.cpp \
+    UIProcess/API/C/WKIntentServiceInfo.cpp \
     UIProcess/API/C/WKNotification.cpp \
     UIProcess/API/C/WKNotificationManager.cpp \
     UIProcess/API/C/WKNotificationPermissionRequest.cpp \

Added: trunk/Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.cpp (0 => 121449)


--- trunk/Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.cpp	2012-06-28 19:20:28 UTC (rev 121449)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKIntentServiceInfo.h"
+
+#include "WKAPICast.h"
+
+#if ENABLE(WEB_INTENTS_TAG)
+#include "WebIntentServiceInfo.h"
+#endif
+
+using namespace WebKit;
+
+WKTypeID WKIntentServiceInfoGetTypeID()
+{
+#if ENABLE(WEB_INTENTS_TAG)
+    return toAPI(WebIntentServiceInfo::APIType);
+#else
+    return 0;
+#endif
+}
+
+WKStringRef WKIntentServiceInfoCopyAction(WKIntentServiceInfoRef serviceRef)
+{
+#if ENABLE(WEB_INTENTS_TAG)
+    return toCopiedAPI(toImpl(serviceRef)->action());
+#else
+    return 0;
+#endif
+}
+
+WKStringRef WKIntentServiceInfoCopyType(WKIntentServiceInfoRef serviceRef)
+{
+#if ENABLE(WEB_INTENTS_TAG)
+    return toCopiedAPI(toImpl(serviceRef)->payloadType());
+#else
+    return 0;
+#endif
+}
+
+WKURLRef WKIntentServiceInfoCopyHref(WKIntentServiceInfoRef serviceRef)
+{
+#if ENABLE(WEB_INTENTS_TAG)
+    return toCopiedURLAPI(toImpl(serviceRef)->href());
+#else
+    return 0;
+#endif
+}
+
+WKStringRef WKIntentServiceInfoCopyTitle(WKIntentServiceInfoRef serviceRef)
+{
+#if ENABLE(WEB_INTENTS_TAG)
+    return toCopiedAPI(toImpl(serviceRef)->title());
+#else
+    return 0;
+#endif
+}
+
+WKStringRef WKIntentServiceInfoCopyDisposition(WKIntentServiceInfoRef serviceRef)
+{
+#if ENABLE(WEB_INTENTS_TAG)
+    return toCopiedAPI(toImpl(serviceRef)->disposition());
+#else
+    return 0;
+#endif
+}

Added: trunk/Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.h (0 => 121449)


--- trunk/Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKIntentServiceInfo.h	2012-06-28 19:20:28 UTC (rev 121449)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKIntentServiceInfo_h
+#define WKIntentServiceInfo_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKIntentServiceInfoGetTypeID();
+WK_EXPORT WKStringRef WKIntentServiceInfoCopyAction(WKIntentServiceInfoRef serviceRef);
+WK_EXPORT WKStringRef WKIntentServiceInfoCopyType(WKIntentServiceInfoRef serviceRef);
+WK_EXPORT WKURLRef WKIntentServiceInfoCopyHref(WKIntentServiceInfoRef serviceRef);
+WK_EXPORT WKStringRef WKIntentServiceInfoCopyTitle(WKIntentServiceInfoRef serviceRef);
+WK_EXPORT WKStringRef WKIntentServiceInfoCopyDisposition(WKIntentServiceInfoRef serviceRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKIntentServiceInfo_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to