Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2790893004: Delete Android content detectors. (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 0b17723ee943849691be3cfd73584a5b776dcde6..2e69eb5f614b12bf4de6b8207b492ec6fc8eee0f 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -715,7 +715,6 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
.isScrollbarHandlingGestures())
break;
endActiveFlingAnimation();
- m_client->cancelScheduledContentIntents();
m_positionOnFlingStart = WebPoint(event.x, event.y);
m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY);
m_flingModifier = event.modifiers();
@@ -764,7 +763,6 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
case WebInputEvent::GestureDoubleTap:
if (m_webSettings->doubleTapToZoomEnabled() &&
minimumPageScaleFactor() != maximumPageScaleFactor()) {
- m_client->cancelScheduledContentIntents();
animateDoubleTapZoom(
flooredIntPoint(scaledEvent.positionInRootFrame()));
}
@@ -775,7 +773,6 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
m_client->didHandleGestureEvent(event, eventCancelled);
return eventResult;
case WebInputEvent::GestureScrollBegin:
- m_client->cancelScheduledContentIntents();
case WebInputEvent::GestureScrollEnd:
case WebInputEvent::GestureScrollUpdate:
case WebInputEvent::GestureFlingStart:
@@ -822,12 +819,6 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
switch (event.type()) {
case WebInputEvent::GestureTap: {
- m_client->cancelScheduledContentIntents();
- if (detectContentOnTouch(targetedEvent)) {
- eventResult = WebInputEventResult::HandledSystem;
- break;
- }
-
// Don't trigger a disambiguation popup on sites designed for mobile
// devices. Instead, assume that the page has been designed with big
// enough buttons and links. Don't trigger a disambiguation popup when
@@ -894,7 +885,6 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
if (!mainFrameImpl() || !mainFrameImpl()->frameView())
break;
- m_client->cancelScheduledContentIntents();
m_page->contextMenuController().clearContextMenu();
{
ContextMenuAllowedScope scope;
@@ -926,7 +916,6 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
break;
}
case WebInputEvent::GestureShowPress: {
- m_client->cancelScheduledContentIntents();
eventResult = mainFrameImpl()->frame()->eventHandler().handleGestureEvent(
targetedEvent);
break;
@@ -4110,44 +4099,6 @@ void WebViewImpl::updateDeviceEmulationTransform() {
m_layerTreeView->forceRecalculateRasterScales();
}
-bool WebViewImpl::detectContentOnTouch(
- const GestureEventWithHitTestResults& targetedEvent) {
- if (!m_page->mainFrame()->isLocalFrame())
- return false;
-
- // Need a local copy of the hit test as
- // setToShadowHostIfInUserAgentShadowRoot() will modify it.
- HitTestResult touchHit = targetedEvent.hitTestResult();
- touchHit.setToShadowHostIfInRestrictedShadowRoot();
-
- if (touchHit.isContentEditable())
- return false;
-
- Node* node = touchHit.innerNode();
- if (!node || !node->isTextNode())
- return false;
-
- // Ignore when tapping on links or nodes listening to click events, unless
- // the click event is on the body element, in which case it's unlikely that
- // the original node itself was intended to be clickable.
- for (; node && !isHTMLBodyElement(*node);
- node = LayoutTreeBuilderTraversal::parent(*node)) {
- if (node->isLink() || node->willRespondToTouchEvents() ||
- node->willRespondToMouseClickEvents())
- return false;
- }
-
- WebURL intent = m_client->detectContentIntentAt(touchHit);
- if (!intent.isValid())
- return false;
-
- // This code is called directly after hit test code, with no user code
- // running in between, thus it is assumed that the frame pointer is non-null.
- bool isMainFrame = node ? node->document().frame()->isMainFrame() : true;
- m_client->scheduleContentIntent(intent, isMainFrame);
- return true;
-}
-
WebViewScheduler* WebViewImpl::scheduler() const {
return m_scheduler.get();
}
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698