| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 eventType = PlatformEvent::MouseReleased; | 368 eventType = PlatformEvent::MouseReleased; |
| 369 | 369 |
| 370 PlatformMouseEvent mouseEvent( | 370 PlatformMouseEvent mouseEvent( |
| 371 targetedEvent.event().position(), targetedEvent.event().globalPosition(), | 371 targetedEvent.event().position(), targetedEvent.event().globalPosition(), |
| 372 WebPointerProperties::Button::Right, eventType, /* clickCount */ 1, | 372 WebPointerProperties::Button::Right, eventType, /* clickCount */ 1, |
| 373 static_cast<PlatformEvent::Modifiers>( | 373 static_cast<PlatformEvent::Modifiers>( |
| 374 modifiers | PlatformEvent::Modifiers::RightButtonDown), | 374 modifiers | PlatformEvent::Modifiers::RightButtonDown), |
| 375 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), | 375 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), |
| 376 WebPointerProperties::PointerType::Mouse); | 376 WebPointerProperties::PointerType::Mouse); |
| 377 | 377 |
| 378 if (!m_suppressMouseEventsFromGestures && m_frame->view()) { |
| 379 HitTestRequest request(HitTestRequest::Active); |
| 380 LayoutPoint documentPoint = |
| 381 m_frame->view()->rootFrameToContents(targetedEvent.event().position()); |
| 382 MouseEventWithHitTestResults mev = |
| 383 m_frame->document()->performMouseEventHitTest(request, documentPoint, |
| 384 mouseEvent); |
| 385 m_mouseEventManager->handleMouseFocus( |
| 386 mev.hitTestResult(), |
| 387 InputDeviceCapabilities::firesTouchEventsSourceCapabilities()); |
| 388 } |
| 378 return m_frame->eventHandler().sendContextMenuEvent(mouseEvent); | 389 return m_frame->eventHandler().sendContextMenuEvent(mouseEvent); |
| 379 } | 390 } |
| 380 | 391 |
| 381 WebInputEventResult GestureManager::handleGestureShowPress() { | 392 WebInputEventResult GestureManager::handleGestureShowPress() { |
| 382 m_lastShowPressTimestamp = WTF::monotonicallyIncreasingTime(); | 393 m_lastShowPressTimestamp = WTF::monotonicallyIncreasingTime(); |
| 383 | 394 |
| 384 FrameView* view = m_frame->view(); | 395 FrameView* view = m_frame->view(); |
| 385 if (!view) | 396 if (!view) |
| 386 return WebInputEventResult::NotHandled; | 397 return WebInputEventResult::NotHandled; |
| 387 if (ScrollAnimatorBase* scrollAnimator = view->existingScrollAnimator()) | 398 if (ScrollAnimatorBase* scrollAnimator = view->existingScrollAnimator()) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 402 return nullptr; | 413 return nullptr; |
| 403 | 414 |
| 404 return &m_frame->page()->frameHost(); | 415 return &m_frame->page()->frameHost(); |
| 405 } | 416 } |
| 406 | 417 |
| 407 double GestureManager::getLastShowPressTimestamp() const { | 418 double GestureManager::getLastShowPressTimestamp() const { |
| 408 return m_lastShowPressTimestamp; | 419 return m_lastShowPressTimestamp; |
| 409 } | 420 } |
| 410 | 421 |
| 411 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |