Changeset 126061 in webkit


Ignore:
Timestamp:
Aug 20, 2012 1:48:52 PM (12 years ago)
Author:
leandrogracia@chromium.org
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):

Location:
trunk/Source/WebKit/chromium
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r126057 r126061  
     12012-08-20  Leandro Gracia Gil  <leandrogracia@chromium.org>
     2
     3        [Chromium] detectContentIntentAround has a misleading name
     4        https://bugs.webkit.org/show_bug.cgi?id=94349
     5
     6        Reviewed by Adam Barth.
     7
     8        The current WebViewClient API exposes a method named detectContentIntentAround.
     9        However, this is not designed to detect any "content intent", but to allow the embedder
     10        to detect content around a position and fire Android intents if appropriate.
     11
     12        This patch also disables content detection if the touched node listens to events
     13        that consume the tap action like clicks, touch events or mouse events.
     14
     15        * public/WebViewClient.h:
     16        (WebViewClient):
     17        (WebKit::WebViewClient::detectContentAround):
     18        * src/WebViewImpl.cpp:
     19        (WebKit::WebViewImpl::detectContentOnTouch):
     20        * src/WebViewImpl.h:
     21        (WebViewImpl):
     22
    1232012-08-20  Hans Wennborg  <hans@chromium.org>
    224
  • trunk/Source/WebKit/chromium/public/WebViewClient.h

    r125219 r126061  
    3838#include "WebFileChooserCompletion.h"
    3939#include "WebFileChooserParams.h"
    40 #include "WebHitTestResult.h"
    4140#include "WebPageVisibilityState.h"
    4241#include "WebPopupType.h"
     
    6564class WebGeolocationService;
    6665class WebHelperPlugin;
     66class WebHitTestResult;
    6767class WebIconLoadingCompletion;
    6868class WebImage;
     
    375375    // Retrieves detectable content (e.g., email addresses, phone numbers)
    376376    // around a hit test result. The embedder should use platform-specific
    377     // content detectors (e.g., from the Android intent system) to analyze the
    378     // region around the hit test result.
    379     virtual WebContentDetectionResult detectContentIntentAround(const WebHitTestResult&) { return WebContentDetectionResult(); }
     377    // content detectors to analyze the region around the hit test result.
     378    virtual WebContentDetectionResult detectContentAround(const WebHitTestResult&) { return WebContentDetectionResult(); }
    380379
    381380    // Schedules a new content intent with the provided url.
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r126057 r126061  
    130130#include "WebFrameImpl.h"
    131131#include "WebHelperPluginImpl.h"
     132#include "WebHitTestResult.h"
    132133#include "WebInputElement.h"
    133134#include "WebInputEvent.h"
     
    38533854}
    38543855
    3855 bool WebViewImpl::detectContentIntentOnTouch(const WebPoint& position, WebInputEvent::Type touchType)
     3856bool WebViewImpl::detectContentOnTouch(const WebPoint& position, WebInputEvent::Type touchType)
    38563857{
    38573858    ASSERT(touchType == WebInputEvent::GestureTap || touchType == WebInputEvent::GestureLongPress);
     
    38673868    // FIXME: Should we not detect content intents in nodes that have event listeners?
    38683869
    3869     WebContentDetectionResult content = m_client->detectContentIntentAround(touchHit);
     3870    WebContentDetectionResult content = m_client->detectContentAround(touchHit);
    38703871    if (!content.isValid())
    38713872        return false;
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r125339 r126061  
    392392    void mouseDoubleClick(const WebMouseEvent&);
    393393
    394     bool detectContentIntentOnTouch(const WebPoint&, WebInputEvent::Type);
     394    bool detectContentOnTouch(const WebPoint&, WebInputEvent::Type);
    395395    void startPageScaleAnimation(const WebCore::IntPoint& targetPosition, bool useAnchor, float newScale, double durationInSeconds);
    396396
Note: See TracChangeset for help on using the changeset viewer.