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

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

Issue 2687903002: Track constant InputDeviceCapabilities objects per-window. (Closed)
Patch Set: Created 3 years, 10 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 672
673 // m_selectionInitiationState is initialized after dispatching mousedown 673 // m_selectionInitiationState is initialized after dispatching mousedown
674 // event in order not to keep the selection by DOM APIs because we can't 674 // event in order not to keep the selection by DOM APIs because we can't
675 // give the user the chance to handle the selection by user action like 675 // give the user the chance to handle the selection by user action like
676 // dragging if we keep the selection in case of mousedown. FireFox also has 676 // dragging if we keep the selection in case of mousedown. FireFox also has
677 // the same behavior and it's more compatible with other browsers. 677 // the same behavior and it's more compatible with other browsers.
678 selectionController().initializeSelectionState(); 678 selectionController().initializeSelectionState();
679 HitTestResult hitTestResult = EventHandlingUtil::hitTestResultInFrame( 679 HitTestResult hitTestResult = EventHandlingUtil::hitTestResultInFrame(
680 m_frame, documentPoint, HitTestRequest::ReadOnly); 680 m_frame, documentPoint, HitTestRequest::ReadOnly);
681 InputDeviceCapabilities* sourceCapabilities = 681 InputDeviceCapabilities* sourceCapabilities =
682 mouseEvent.getSyntheticEventType() == PlatformMouseEvent::FromTouch 682 m_frame->document()
683 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() 683 ->domWindow()
684 : InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities(); 684 ->getInputDeviceCapabilities()
685 ->firesTouchEvents(
686 mouseEvent.getSyntheticEventType() ==
687 PlatformMouseEvent::FromTouch);
688
685 if (eventResult == WebInputEventResult::NotHandled) { 689 if (eventResult == WebInputEventResult::NotHandled) {
686 eventResult = m_mouseEventManager->handleMouseFocus(hitTestResult, 690 eventResult = m_mouseEventManager->handleMouseFocus(hitTestResult,
687 sourceCapabilities); 691 sourceCapabilities);
688 } 692 }
689 m_mouseEventManager->setCapturesDragging( 693 m_mouseEventManager->setCapturesDragging(
690 eventResult == WebInputEventResult::NotHandled || mev.scrollbar()); 694 eventResult == WebInputEventResult::NotHandled || mev.scrollbar());
691 695
692 // If the hit testing originally determined the event was in a scrollbar, 696 // If the hit testing originally determined the event was in a scrollbar,
693 // refetch the MouseEventWithHitTestResults in case the scrollbar widget was 697 // refetch the MouseEventWithHitTestResults in case the scrollbar widget was
694 // destroyed when the mouse event was handled. 698 // destroyed when the mouse event was handled.
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 } 2129 }
2126 2130
2127 FrameHost* EventHandler::frameHost() const { 2131 FrameHost* EventHandler::frameHost() const {
2128 if (!m_frame->page()) 2132 if (!m_frame->page())
2129 return nullptr; 2133 return nullptr;
2130 2134
2131 return &m_frame->page()->frameHost(); 2135 return &m_frame->page()->frameHost();
2132 } 2136 }
2133 2137
2134 } // namespace blink 2138 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.cpp ('k') | third_party/WebKit/Source/core/input/GestureManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698