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/GestureManager.h" | 5 #include "core/input/GestureManager.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/editing/SelectionController.h" | 8 #include "core/editing/SelectionController.h" |
9 #include "core/events/GestureEvent.h" | 9 #include "core/events/GestureEvent.h" |
10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return hitType | HitTestRequest::Active | HitTestRequest::ReadOnly; | 64 return hitType | HitTestRequest::Active | HitTestRequest::ReadOnly; |
65 default: | 65 default: |
66 NOTREACHED(); | 66 NOTREACHED(); |
67 return hitType | HitTestRequest::Active | HitTestRequest::ReadOnly; | 67 return hitType | HitTestRequest::Active | HitTestRequest::ReadOnly; |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 WebInputEventResult GestureManager::handleGestureEventInFrame( | 71 WebInputEventResult GestureManager::handleGestureEventInFrame( |
72 const GestureEventWithHitTestResults& targetedEvent) { | 72 const GestureEventWithHitTestResults& targetedEvent) { |
73 DCHECK(!targetedEvent.event().isScrollEvent()); | 73 DCHECK(!targetedEvent.event().isScrollEvent()); |
| 74 m_frame->document()->setHasReceivedUserGesture(); |
74 | 75 |
75 Node* eventTarget = targetedEvent.hitTestResult().innerNode(); | 76 Node* eventTarget = targetedEvent.hitTestResult().innerNode(); |
76 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); | 77 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); |
77 | 78 |
78 if (m_scrollManager->canHandleGestureEvent(targetedEvent)) | 79 if (m_scrollManager->canHandleGestureEvent(targetedEvent)) |
79 return WebInputEventResult::HandledSuppressed; | 80 return WebInputEventResult::HandledSuppressed; |
80 | 81 |
81 if (eventTarget) { | 82 if (eventTarget) { |
82 GestureEvent* gestureDomEvent = | 83 GestureEvent* gestureDomEvent = |
83 GestureEvent::create(eventTarget->document().domWindow(), gestureEvent); | 84 GestureEvent::create(eventTarget->document().domWindow(), gestureEvent); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 return nullptr; | 408 return nullptr; |
408 | 409 |
409 return &m_frame->page()->frameHost(); | 410 return &m_frame->page()->frameHost(); |
410 } | 411 } |
411 | 412 |
412 double GestureManager::getLastShowPressTimestamp() const { | 413 double GestureManager::getLastShowPressTimestamp() const { |
413 return m_lastShowPressTimestamp; | 414 return m_lastShowPressTimestamp; |
414 } | 415 } |
415 | 416 |
416 } // namespace blink | 417 } // namespace blink |
OLD | NEW |