| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/input/TouchEventManager.h" | 5 #include "core/input/TouchEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/events/TouchEvent.h" | 8 #include "core/events/TouchEvent.h" |
| 9 #include "core/frame/Deprecation.h" | 9 #include "core/frame/Deprecation.h" |
| 10 #include "core/frame/EventHandlerRegistry.h" | 10 #include "core/frame/EventHandlerRegistry.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 allTouchesReleased = false; | 453 allTouchesReleased = false; |
| 454 } | 454 } |
| 455 | 455 |
| 456 // Whether a touch should be considered a "user gesture" or not is a tricky
question. | 456 // Whether a touch should be considered a "user gesture" or not is a tricky
question. |
| 457 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZ
u7nvOg/edit# | 457 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZ
u7nvOg/edit# |
| 458 | 458 |
| 459 // The touchend corresponding to a tap is always a user gesture. | 459 // The touchend corresponding to a tap is always a user gesture. |
| 460 bool isTap = event.touchPoints().size() == 1 | 460 bool isTap = event.touchPoints().size() == 1 |
| 461 && event.touchPoints()[0].state() == PlatformTouchPoint::TouchReleased | 461 && event.touchPoints()[0].state() == PlatformTouchPoint::TouchReleased |
| 462 && !event.causesScrollingIfUncanceled(); | 462 && !event.causesScrollingIfUncanceled(); |
| 463 | 463 VLOG(0) << "TouchEventManager::handleTouchEvent: " << isTap; |
| 464 // For now, disallow dragging as a user gesture when the events are being se
nt to a | 464 // For now, disallow dragging as a user gesture when the events are being se
nt to a |
| 465 // cross-origin iframe (crbug.com/582140). | 465 // cross-origin iframe (crbug.com/582140). |
| 466 bool isSameOrigin = false; | 466 bool isSameOrigin = false; |
| 467 if (m_touchSequenceDocument && m_touchSequenceDocument->frame()) { | 467 if (m_touchSequenceDocument && m_touchSequenceDocument->frame()) { |
| 468 SecurityOrigin* securityOrigin = m_touchSequenceDocument->frame()->secur
ityContext()->getSecurityOrigin(); | 468 SecurityOrigin* securityOrigin = m_touchSequenceDocument->frame()->secur
ityContext()->getSecurityOrigin(); |
| 469 Frame* top = m_frame->tree().top(); | 469 Frame* top = m_frame->tree().top(); |
| 470 if (top && securityOrigin->canAccess(top->securityContext()->getSecurity
Origin())) | 470 if (top && securityOrigin->canAccess(top->securityContext()->getSecurity
Origin())) |
| 471 isSameOrigin = true; | 471 isSameOrigin = true; |
| 472 } | 472 } |
| 473 | 473 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 feature = UseCounter::TouchEndDuringScrollUserGestureUtilized; | 533 feature = UseCounter::TouchEndDuringScrollUserGestureUtilized; |
| 534 break; | 534 break; |
| 535 default: | 535 default: |
| 536 NOTREACHED(); | 536 NOTREACHED(); |
| 537 return; | 537 return; |
| 538 } | 538 } |
| 539 Deprecation::countDeprecation(m_frame, feature); | 539 Deprecation::countDeprecation(m_frame, feature); |
| 540 } | 540 } |
| 541 | 541 |
| 542 } // namespace blink | 542 } // namespace blink |
| OLD | NEW |