| 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/dom/DocumentUserGestureToken.h" | 8 #include "core/dom/DocumentUserGestureToken.h" |
| 9 #include "core/editing/SelectionController.h" | 9 #include "core/editing/SelectionController.h" |
| 10 #include "core/events/GestureEvent.h" | 10 #include "core/events/GestureEvent.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 adjusted_point = frame_view->RootFrameToContents( | 181 adjusted_point = frame_view->RootFrameToContents( |
| 182 FlooredIntPoint(gesture_event.PositionInRootFrame())); | 182 FlooredIntPoint(gesture_event.PositionInRootFrame())); |
| 183 current_hit_test = EventHandlingUtil::HitTestResultInFrame( | 183 current_hit_test = EventHandlingUtil::HitTestResultInFrame( |
| 184 frame_, adjusted_point, hit_type); | 184 frame_, adjusted_point, hit_type); |
| 185 } | 185 } |
| 186 | 186 |
| 187 // Capture data for showUnhandledTapUIIfNeeded. | 187 // Capture data for showUnhandledTapUIIfNeeded. |
| 188 IntPoint tapped_position = | 188 IntPoint tapped_position = |
| 189 FlooredIntPoint(gesture_event.PositionInRootFrame()); | 189 FlooredIntPoint(gesture_event.PositionInRootFrame()); |
| 190 Node* tapped_node = current_hit_test.InnerNode(); | 190 Node* tapped_node = current_hit_test.InnerNode(); |
| 191 Element* tapped_element = | 191 Element* tapped_element = current_hit_test.InnerElement(); |
| 192 EventHandlingUtil::ParentElementIfNeeded(tapped_node); | |
| 193 UserGestureIndicator gesture_indicator(DocumentUserGestureToken::Create( | 192 UserGestureIndicator gesture_indicator(DocumentUserGestureToken::Create( |
| 194 tapped_node ? &tapped_node->GetDocument() : nullptr)); | 193 tapped_node ? &tapped_node->GetDocument() : nullptr)); |
| 195 | 194 |
| 196 mouse_event_manager_->SetClickElement(tapped_element); | 195 mouse_event_manager_->SetClickElement(tapped_element); |
| 197 | 196 |
| 198 WebMouseEvent fake_mouse_down( | 197 WebMouseEvent fake_mouse_down( |
| 199 WebInputEvent::kMouseDown, gesture_event, | 198 WebInputEvent::kMouseDown, gesture_event, |
| 200 WebPointerProperties::Button::kLeft, gesture_event.TapCount(), | 199 WebPointerProperties::Button::kLeft, gesture_event.TapCount(), |
| 201 static_cast<WebInputEvent::Modifiers>( | 200 static_cast<WebInputEvent::Modifiers>( |
| 202 modifiers | WebInputEvent::Modifiers::kLeftButtonDown | | 201 modifiers | WebInputEvent::Modifiers::kLeftButtonDown | |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 } | 429 } |
| 431 return WebInputEventResult::kNotHandled; | 430 return WebInputEventResult::kNotHandled; |
| 432 } | 431 } |
| 433 | 432 |
| 434 WTF::Optional<WTF::TimeTicks> GestureManager::GetLastShowPressTimestamp() | 433 WTF::Optional<WTF::TimeTicks> GestureManager::GetLastShowPressTimestamp() |
| 435 const { | 434 const { |
| 436 return last_show_press_timestamp_; | 435 return last_show_press_timestamp_; |
| 437 } | 436 } |
| 438 | 437 |
| 439 } // namespace blink | 438 } // namespace blink |
| OLD | NEW |