Title: [124478] trunk/Source
Revision
124478
Author
[email protected]
Date
2012-08-02 10:40:27 -0700 (Thu, 02 Aug 2012)

Log Message

[Chromium] Add a stub for WebView::getTouchHighlightQuads()
https://bugs.webkit.org/show_bug.cgi?id=92997

Reviewed by Adam Barth.

Chrome on Android will be using this method for the link preview
implementation, discussion about which is available in Bug 79150. Since
that system is fairly big, will require refactoring, and the unavailable
APIs are blocking API compatibility, add a stub for now.

Together with the WebView API, also add the "WebTouchCandidatesInfo"
structure which is being used by it.

Source/Platform:

* Platform.gypi: List WebTouchCandidatesInfo.h
* chromium/public/WebTouchCandidatesInfo.h: Added.
(WebKit):
(WebTouchCandidatesInfo):
(WebKit::WebTouchCandidatesInfo::WebTouchCandidatesInfo):

Source/WebKit/chromium:

* public/WebView.h:
(WebKit):
(WebView):
* src/WebViewImpl.cpp:
(WebKit):
(WebKit::WebViewImpl::getTouchHighlightQuads):
* src/WebViewImpl.h:
(WebViewImpl):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (124477 => 124478)


--- trunk/Source/Platform/ChangeLog	2012-08-02 17:36:59 UTC (rev 124477)
+++ trunk/Source/Platform/ChangeLog	2012-08-02 17:40:27 UTC (rev 124478)
@@ -1,3 +1,24 @@
+2012-08-02  Peter Beverloo  <[email protected]>
+
+        [Chromium] Add a stub for WebView::getTouchHighlightQuads()
+        https://bugs.webkit.org/show_bug.cgi?id=92997
+
+        Reviewed by Adam Barth.
+
+        Chrome on Android will be using this method for the link preview
+        implementation, discussion about which is available in Bug 79150. Since
+        that system is fairly big, will require refactoring, and the unavailable
+        APIs are blocking API compatibility, add a stub for now.
+
+        Together with the WebView API, also add the "WebTouchCandidatesInfo"
+        structure which is being used by it.
+
+        * Platform.gypi: List WebTouchCandidatesInfo.h
+        * chromium/public/WebTouchCandidatesInfo.h: Added.
+        (WebKit):
+        (WebTouchCandidatesInfo):
+        (WebKit::WebTouchCandidatesInfo::WebTouchCandidatesInfo):
+
 2012-08-02  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Add RTCPeerConnectionHandler infrastructure

Modified: trunk/Source/Platform/Platform.gypi (124477 => 124478)


--- trunk/Source/Platform/Platform.gypi	2012-08-02 17:36:59 UTC (rev 124477)
+++ trunk/Source/Platform/Platform.gypi	2012-08-02 17:40:27 UTC (rev 124478)
@@ -127,6 +127,7 @@
             'chromium/public/WebString.h',
             'chromium/public/WebThread.h',
             'chromium/public/WebThreadSafeData.h',
+            'chromium/public/WebTouchCandidatesInfo.h',
             'chromium/public/WebTransformationMatrix.h',
             'chromium/public/WebTransformAnimationCurve.h',
             'chromium/public/WebTransformKeyframe.h',

Added: trunk/Source/Platform/chromium/public/WebTouchCandidatesInfo.h (0 => 124478)


--- trunk/Source/Platform/chromium/public/WebTouchCandidatesInfo.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/WebTouchCandidatesInfo.h	2012-08-02 17:40:27 UTC (rev 124478)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 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:
+ *
+ * 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 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 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 WebTouchCandidatesInfo_h
+#define WebTouchCandidatesInfo_h
+
+#include "WebRect.h"
+
+namespace WebKit {
+
+struct WebTouchCandidatesInfo {
+    // The number of possible touch receivers from the last touch.
+    int numberOfCandidates;
+
+    // The bounds of the possible touch candidates. This will enclose the
+    // rects of any possible touch candidates for a press.
+    WebRect unitedBounds;
+
+    // The smallest dimension (either width or height) of any of the
+    // available touch targets.
+    int smallestDimension;
+
+    WebTouchCandidatesInfo()
+        : numberOfCandidates(0)
+        , smallestDimension(0)
+    {
+    }
+};
+
+} // namespace WebKit
+
+#endif

Modified: trunk/Source/WebKit/chromium/ChangeLog (124477 => 124478)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-02 17:36:59 UTC (rev 124477)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-02 17:40:27 UTC (rev 124478)
@@ -1,3 +1,27 @@
+2012-08-02  Peter Beverloo  <[email protected]>
+
+        [Chromium] Add a stub for WebView::getTouchHighlightQuads()
+        https://bugs.webkit.org/show_bug.cgi?id=92997
+
+        Reviewed by Adam Barth.
+
+        Chrome on Android will be using this method for the link preview
+        implementation, discussion about which is available in Bug 79150. Since
+        that system is fairly big, will require refactoring, and the unavailable
+        APIs are blocking API compatibility, add a stub for now.
+
+        Together with the WebView API, also add the "WebTouchCandidatesInfo"
+        structure which is being used by it.
+
+        * public/WebView.h:
+        (WebKit):
+        (WebView):
+        * src/WebViewImpl.cpp:
+        (WebKit):
+        (WebKit::WebViewImpl::getTouchHighlightQuads):
+        * src/WebViewImpl.h:
+        (WebViewImpl):
+
 2012-08-02  Hans Wennborg  <[email protected]>
 
         Speech _javascript_ API: Fire speech start event at the same time as sound start event

Modified: trunk/Source/WebKit/chromium/public/WebView.h (124477 => 124478)


--- trunk/Source/WebKit/chromium/public/WebView.h	2012-08-02 17:36:59 UTC (rev 124477)
+++ trunk/Source/WebKit/chromium/public/WebView.h	2012-08-02 17:40:27 UTC (rev 124478)
@@ -60,9 +60,11 @@
 class WebTextFieldDecoratorClient;
 class WebViewClient;
 struct WebActiveWheelFlingParameters;
+struct WebFloatQuad;
 struct WebMediaPlayerAction;
 struct WebPluginAction;
 struct WebPoint;
+struct WebTouchCandidatesInfo;
 
 class WebView : public WebWidget {
 public:
@@ -461,10 +463,24 @@
 
     virtual bool isSelectionEditable() const = 0;
 
-    // Benchmarking support --------------------------------------------
+    // Benchmarking support -------------------------------------------------
 
     virtual WebViewBenchmarkSupport* benchmarkSupport() { return 0; }
 
+
+    // Touch ----------------------------------------------------------------
+
+    // Returns a list of layout bounding boxes of the event target node touched by
+    // the input point with the padding. If no target node is found, an empty
+    // list is returned. If the node is of an inline type, each line box is returned
+    // separately. Otherwise, one bounding box is returned. Also returns information
+    // about the found candidates and their dimension, and the highlight color to use.
+    virtual WebVector<WebFloatQuad> getTouchHighlightQuads(const WebPoint&,
+                                                           int padding,
+                                                           WebTouchCandidatesInfo& outTouchInfo,
+                                                           WebColor& outTapHighlightColor) = 0;
+
+
     // Visibility -----------------------------------------------------------
 
     // Sets the visibility of the WebView.

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (124477 => 124478)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-02 17:36:59 UTC (rev 124477)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-02 17:40:27 UTC (rev 124478)
@@ -163,6 +163,7 @@
 #include <public/WebLayerTreeView.h>
 #include <public/WebPoint.h>
 #include <public/WebRect.h>
+#include <public/WebTouchCandidatesInfo.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/MainThread.h>
 #include <wtf/RefPtr.h>
@@ -792,6 +793,17 @@
     return &m_benchmarkSupport;
 }
 
+WebVector<WebFloatQuad> WebViewImpl::getTouchHighlightQuads(const WebPoint& point,
+                                                            int padding,
+                                                            WebTouchCandidatesInfo& outTouchInfo,
+                                                            WebColor& outTapHighlightColor)
+{
+    // FIXME: Upstream this function from the chromium-android branch.
+    notImplemented();
+
+    return WebVector<WebFloatQuad>();
+}
+
 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
 {
     ASSERT((event.type == WebInputEvent::RawKeyDown)

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (124477 => 124478)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2012-08-02 17:36:59 UTC (rev 124477)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2012-08-02 17:40:27 UTC (rev 124478)
@@ -302,6 +302,11 @@
     virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&);
     virtual WebViewBenchmarkSupport* benchmarkSupport();
 
+    virtual WebVector<WebFloatQuad> getTouchHighlightQuads(const WebPoint&,
+                                                           int padding,
+                                                           WebTouchCandidatesInfo& outTouchInfo,
+                                                           WebColor& outTapHighlightColor);
+
     // WebLayerTreeViewClient
     virtual void willBeginFrame();
     virtual void didBeginFrame();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to