Chromium Code Reviews| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 | 132 |
| 133 WebInputEventResult GestureManager::handleGestureTap( | 133 WebInputEventResult GestureManager::handleGestureTap( |
| 134 const GestureEventWithHitTestResults& targetedEvent) { | 134 const GestureEventWithHitTestResults& targetedEvent) { |
| 135 FrameView* frameView(m_frame->view()); | 135 FrameView* frameView(m_frame->view()); |
| 136 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); | 136 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); |
| 137 HitTestRequest::HitTestRequestType hitType = | 137 HitTestRequest::HitTestRequestType hitType = |
| 138 getHitTypeForGestureType(gestureEvent.type()); | 138 getHitTypeForGestureType(gestureEvent.type()); |
| 139 uint64_t preDispatchDomTreeVersion = m_frame->document()->domTreeVersion(); | 139 uint64_t preDispatchDomTreeVersion = m_frame->document()->domTreeVersion(); |
| 140 uint64_t preDispatchStyleVersion = m_frame->document()->styleVersion(); | 140 uint64_t preDispatchStyleVersion = m_frame->document()->styleVersion(); |
| 141 | 141 |
| 142 // TODO(japhet): UserGestureIndicator should setHasReceivedUserGesture() | |
| 143 // on the Document. | |
| 142 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); | 144 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); |
|
Rick Byers
2016/10/06 16:26:47
for really simple cases like this, perhaps we shou
| |
| 145 m_frame->document()->setHasReceivedUserGesture(); | |
| 143 | 146 |
| 144 HitTestResult currentHitTest = targetedEvent.hitTestResult(); | 147 HitTestResult currentHitTest = targetedEvent.hitTestResult(); |
| 145 | 148 |
| 146 // We use the adjusted position so the application isn't surprised to see a | 149 // We use the adjusted position so the application isn't surprised to see a |
| 147 // event with co-ordinates outside the target's bounds. | 150 // event with co-ordinates outside the target's bounds. |
| 148 IntPoint adjustedPoint = | 151 IntPoint adjustedPoint = |
| 149 frameView->rootFrameToContents(gestureEvent.position()); | 152 frameView->rootFrameToContents(gestureEvent.position()); |
| 150 | 153 |
| 151 const unsigned modifiers = gestureEvent.getModifiers(); | 154 const unsigned modifiers = gestureEvent.getModifiers(); |
| 152 | 155 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 return nullptr; | 421 return nullptr; |
| 419 | 422 |
| 420 return &m_frame->page()->frameHost(); | 423 return &m_frame->page()->frameHost(); |
| 421 } | 424 } |
| 422 | 425 |
| 423 double GestureManager::getLastShowPressTimestamp() const { | 426 double GestureManager::getLastShowPressTimestamp() const { |
| 424 return m_lastShowPressTimestamp; | 427 return m_lastShowPressTimestamp; |
| 425 } | 428 } |
| 426 | 429 |
| 427 } // namespace blink | 430 } // namespace blink |
| OLD | NEW |