Title: [126061] trunk/Source/WebKit/chromium
Revision
126061
Author
[email protected]
Date
2012-08-20 13:48:52 -0700 (Mon, 20 Aug 2012)

Log Message

[Chromium] detectContentIntentAround has a misleading name
https://bugs.webkit.org/show_bug.cgi?id=94349

Reviewed by Adam Barth.

The current WebViewClient API exposes a method named detectContentIntentAround.
However, this is not designed to detect any "content intent", but to allow the embedder
to detect content around a position and fire Android intents if appropriate.

This patch also disables content detection if the touched node listens to events
that consume the tap action like clicks, touch events or mouse events.

* public/WebViewClient.h:
(WebViewClient):
(WebKit::WebViewClient::detectContentAround):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::detectContentOnTouch):
* src/WebViewImpl.h:
(WebViewImpl):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (126060 => 126061)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-20 20:44:36 UTC (rev 126060)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-20 20:48:52 UTC (rev 126061)
@@ -1,3 +1,25 @@
+2012-08-20  Leandro Gracia Gil  <[email protected]>
+
+        [Chromium] detectContentIntentAround has a misleading name
+        https://bugs.webkit.org/show_bug.cgi?id=94349
+
+        Reviewed by Adam Barth.
+
+        The current WebViewClient API exposes a method named detectContentIntentAround.
+        However, this is not designed to detect any "content intent", but to allow the embedder
+        to detect content around a position and fire Android intents if appropriate.
+
+        This patch also disables content detection if the touched node listens to events
+        that consume the tap action like clicks, touch events or mouse events.
+
+        * public/WebViewClient.h:
+        (WebViewClient):
+        (WebKit::WebViewClient::detectContentAround):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::detectContentOnTouch):
+        * src/WebViewImpl.h:
+        (WebViewImpl):
+
 2012-08-20  Hans Wennborg  <[email protected]>
 
         Respect runtime flags for Device Orientation and Device Motion

Modified: trunk/Source/WebKit/chromium/public/WebViewClient.h (126060 => 126061)


--- trunk/Source/WebKit/chromium/public/WebViewClient.h	2012-08-20 20:44:36 UTC (rev 126060)
+++ trunk/Source/WebKit/chromium/public/WebViewClient.h	2012-08-20 20:48:52 UTC (rev 126061)
@@ -37,7 +37,6 @@
 #include "WebEditingAction.h"
 #include "WebFileChooserCompletion.h"
 #include "WebFileChooserParams.h"
-#include "WebHitTestResult.h"
 #include "WebPageVisibilityState.h"
 #include "WebPopupType.h"
 #include "WebTextAffinity.h"
@@ -64,6 +63,7 @@
 class WebGeolocationClient;
 class WebGeolocationService;
 class WebHelperPlugin;
+class WebHitTestResult;
 class WebIconLoadingCompletion;
 class WebImage;
 class WebInputElement;
@@ -374,9 +374,8 @@
 
     // Retrieves detectable content (e.g., email addresses, phone numbers)
     // around a hit test result. The embedder should use platform-specific
-    // content detectors (e.g., from the Android intent system) to analyze the
-    // region around the hit test result.
-    virtual WebContentDetectionResult detectContentIntentAround(const WebHitTestResult&) { return WebContentDetectionResult(); }
+    // content detectors to analyze the region around the hit test result.
+    virtual WebContentDetectionResult detectContentAround(const WebHitTestResult&) { return WebContentDetectionResult(); }
 
     // Schedules a new content intent with the provided url.
     virtual void scheduleContentIntent(const WebURL&) { }

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (126060 => 126061)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-20 20:44:36 UTC (rev 126060)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-20 20:48:52 UTC (rev 126061)
@@ -129,6 +129,7 @@
 #include "WebDevToolsAgentPrivate.h"
 #include "WebFrameImpl.h"
 #include "WebHelperPluginImpl.h"
+#include "WebHitTestResult.h"
 #include "WebInputElement.h"
 #include "WebInputEvent.h"
 #include "WebInputEventConversion.h"
@@ -3852,7 +3853,7 @@
         m_autofillPopupClient->valueChanged(listIndex);
 }
 
-bool WebViewImpl::detectContentIntentOnTouch(const WebPoint& position, WebInputEvent::Type touchType)
+bool WebViewImpl::detectContentOnTouch(const WebPoint& position, WebInputEvent::Type touchType)
 {
     ASSERT(touchType == WebInputEvent::GestureTap || touchType == WebInputEvent::GestureLongPress);
     HitTestResult touchHit = hitTestResultForWindowPos(position);
@@ -3866,7 +3867,7 @@
 
     // FIXME: Should we not detect content intents in nodes that have event listeners?
 
-    WebContentDetectionResult content = m_client->detectContentIntentAround(touchHit);
+    WebContentDetectionResult content = m_client->detectContentAround(touchHit);
     if (!content.isValid())
         return false;
 

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (126060 => 126061)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2012-08-20 20:44:36 UTC (rev 126060)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2012-08-20 20:48:52 UTC (rev 126061)
@@ -391,7 +391,7 @@
     void mouseContextMenu(const WebMouseEvent&);
     void mouseDoubleClick(const WebMouseEvent&);
 
-    bool detectContentIntentOnTouch(const WebPoint&, WebInputEvent::Type);
+    bool detectContentOnTouch(const WebPoint&, WebInputEvent::Type);
     void startPageScaleAnimation(const WebCore::IntPoint& targetPosition, bool useAnchor, float newScale, double durationInSeconds);
 
     void numberOfWheelEventHandlersChanged(unsigned);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to