Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Side by Side Diff: third_party/WebKit/Source/core/input/GestureManager.cpp

Issue 2544653002: Adding back Mouse Focus on |sendContextMenuEventForGesture| (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698