Title: [101021] trunk/Source/WebKit/chromium
Revision
101021
Author
commit-qu...@webkit.org
Date
2011-11-22 11:45:27 -0800 (Tue, 22 Nov 2011)

Log Message

Empty API for web intents
https://bugs.webkit.org/show_bug.cgi?id=69870

Patch by Greg Billock <gbill...@google.com> on 2011-11-22
Reviewed by Darin Fisher.

* WebKit.gyp:
* public/WebIntent.h: Added.
* public/WebIntentServiceInfo.h: Added.
* public/WebFrame.h:
* public/WebFrameClient.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (101020 => 101021)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-11-22 19:39:02 UTC (rev 101020)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-11-22 19:45:27 UTC (rev 101021)
@@ -1,3 +1,16 @@
+2011-11-22  Greg Billock  <gbill...@google.com>
+
+        Empty API for web intents
+        https://bugs.webkit.org/show_bug.cgi?id=69870
+
+        Reviewed by Darin Fisher.
+
+        * WebKit.gyp:
+        * public/WebIntent.h: Added.
+        * public/WebIntentServiceInfo.h: Added.
+        * public/WebFrame.h:
+        * public/WebFrameClient.h:
+
 2011-11-22  Scott Graham  <scot...@chromium.org>
 
         Roll Chromium DEPS

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (101020 => 101021)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2011-11-22 19:39:02 UTC (rev 101020)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2011-11-22 19:45:27 UTC (rev 101021)
@@ -226,6 +226,8 @@
                 'public/WebIDBTransactionCallbacks.h',
                 'public/WebInputElement.h',
                 'public/WebInputEvent.h',
+                'public/WebIntent.h',
+                'public/WebIntentServiceInfo.h',
                 'public/WebKit.h',
                 'public/WebKitPlatformSupport.h',
                 'public/WebLabelElement.h',

Modified: trunk/Source/WebKit/chromium/public/WebFrame.h (101020 => 101021)


--- trunk/Source/WebKit/chromium/public/WebFrame.h	2011-11-22 19:39:02 UTC (rev 101020)
+++ trunk/Source/WebKit/chromium/public/WebFrame.h	2011-11-22 19:45:27 UTC (rev 101021)
@@ -544,6 +544,20 @@
     virtual void resetMatchCount() = 0;
 
 
+    // Web Intents ---------------------------------------------------------
+
+    // Forwards a web intents reply from the invoked activity back to the
+    // appropriate registered _javascript_ callback. The |intentIdentifier| is
+    // the WebIntent parameter received from the dispatchIntent method.
+    virtual void handleIntentResult(int intentIdentifier, const WebString&) = 0;
+
+    // Forwards a web intents failure notification from the invoked activity
+    // or intervening browser logic back to the appropriate registered
+    // _javascript_ callback. The |intentIdentifier| is the WebIntent parameter
+    // received from the dispatchIntent method.
+    virtual void handleIntentFailure(int intentIdentifier, const WebString&) = 0;
+
+
     // Utility -------------------------------------------------------------
 
     // Returns the contents of this frame as a string.  If the text is

Modified: trunk/Source/WebKit/chromium/public/WebFrameClient.h (101020 => 101021)


--- trunk/Source/WebKit/chromium/public/WebFrameClient.h	2011-11-22 19:39:02 UTC (rev 101020)
+++ trunk/Source/WebKit/chromium/public/WebFrameClient.h	2011-11-22 19:45:27 UTC (rev 101021)
@@ -52,6 +52,8 @@
 class WebDataSource;
 class WebFormElement;
 class WebFrame;
+class WebIntentServiceInfo;
+class WebIntent;
 class WebMediaPlayer;
 class WebMediaPlayerClient;
 class WebNode;
@@ -381,6 +383,15 @@
         unsigned long long newQuotaInBytes,
         WebStorageQuotaCallbacks*) { }
 
+    // Web Intents ---------------------------------------------------
+
+    // Register a service to handle Web Intents.
+    virtual void registerIntentService(WebFrame*, const WebIntentServiceInfo&) { }
+
+    // Start a Web Intents activity. Replies to this request should be sent to
+    // the WebFrame starting the activity.
+    virtual void dispatchIntent(WebFrame*, const WebIntent&) { }
+
 protected:
     ~WebFrameClient() { }
 };

Added: trunk/Source/WebKit/chromium/public/WebIntent.h (0 => 101021)


--- trunk/Source/WebKit/chromium/public/WebIntent.h	                        (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebIntent.h	2011-11-22 19:45:27 UTC (rev 101021)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 WebIntent_h
+#define WebIntent_h
+
+namespace WebKit {
+
+class WebString;
+
+// Holds data passed through a Web Intents invocation call from the _javascript_
+// Intent object.
+// See spec at http://www.chromium.org/developers/design-documents/webintentsapi
+class WebIntent {
+public:
+    ~WebIntent() { }
+
+    WEBKIT_EXPORT WebString action() const;
+    WEBKIT_EXPORT void setAction(const WebString&);
+
+    WEBKIT_EXPORT WebString type() const;
+    WEBKIT_EXPORT void setType(const WebString&);
+
+    WEBKIT_EXPORT WebString data() const;
+    WEBKIT_EXPORT void setData(const WebString&);
+
+    WEBKIT_EXPORT int identifier() const;
+    WEBKIT_EXPORT void setIdentifier(int);
+};
+
+} // namespace WebKit
+
+#endif // WebIntent_h

Added: trunk/Source/WebKit/chromium/public/WebIntentServiceInfo.h (0 => 101021)


--- trunk/Source/WebKit/chromium/public/WebIntentServiceInfo.h	                        (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebIntentServiceInfo.h	2011-11-22 19:45:27 UTC (rev 101021)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 WebIntentServiceInfo_h
+#define WebIntentServiceInfo_h
+
+namespace WebKit {
+
+class WebString;
+class WebURL;
+
+// Holds data used to initialize a Web Intents service (handler).
+// See spec at http://www.chromium.org/developers/design-documents/webintentsapi
+class WebIntentServiceInfo {
+public:
+    ~WebIntentServiceInfo() { }
+
+    // The location of the handler page registered by the service.
+    WEBKIT_EXPORT WebURL url() const;
+    WEBKIT_EXPORT void setURL(const WebURL&);
+
+    // The short name the service will be known by when the user
+    // initiates an intent.
+    WEBKIT_EXPORT WebString title() const;
+    WEBKIT_EXPORT void setTitle(const WebString&);
+
+    // The kind of intent the service will handle.
+    WEBKIT_EXPORT WebString action() const;
+    WEBKIT_EXPORT void setAction(const WebString&);
+
+    // The type of payload data which the service will handle.
+    WEBKIT_EXPORT WebString type() const;
+    WEBKIT_EXPORT void setType(const WebString&);
+
+    // A hint to the client about whether the service can be run within
+    // an "inline" context within the calling page, or in a new tab
+    // context (the default).
+    WEBKIT_EXPORT WebString disposition() const;
+    WEBKIT_EXPORT void setDisposition(const WebString&);
+};
+
+} // namespace WebKit
+
+#endif // WebIntentServiceInfo_h

Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (101020 => 101021)


--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp	2011-11-22 19:39:02 UTC (rev 101020)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp	2011-11-22 19:45:27 UTC (rev 101021)
@@ -1826,6 +1826,14 @@
     m_framesScopingCount = 0;
 }
 
+void WebFrameImpl::handleIntentResult(int intentIdentifier, const WebString& reply)
+{
+}
+
+void WebFrameImpl::handleIntentFailure(int intentIdentifier, const WebString& reply)
+{
+}
+
 WebString WebFrameImpl::contentAsText(size_t maxChars) const
 {
     if (!m_frame)

Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.h (101020 => 101021)


--- trunk/Source/WebKit/chromium/src/WebFrameImpl.h	2011-11-22 19:39:02 UTC (rev 101020)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.h	2011-11-22 19:45:27 UTC (rev 101021)
@@ -192,6 +192,9 @@
     virtual void increaseMatchCount(int count, int identifier);
     virtual void resetMatchCount();
 
+    virtual void handleIntentResult(int, const WebString&);
+    virtual void handleIntentFailure(int, const WebString&);
+
     virtual WebString contentAsText(size_t maxChars) const;
     virtual WebString contentAsMarkup() const;
     virtual WebString renderTreeAsText(RenderAsTextControls toShow = RenderAsTextNormal) const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to