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

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

Issue 2675793005: Track constant InputDeviceCapabilities objects per-window. (Closed)
Patch Set: test tidying 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 671
672 // m_selectionInitiationState is initialized after dispatching mousedown 672 // m_selectionInitiationState is initialized after dispatching mousedown
673 // event in order not to keep the selection by DOM APIs because we can't 673 // event in order not to keep the selection by DOM APIs because we can't
674 // give the user the chance to handle the selection by user action like 674 // give the user the chance to handle the selection by user action like
675 // dragging if we keep the selection in case of mousedown. FireFox also has 675 // dragging if we keep the selection in case of mousedown. FireFox also has
676 // the same behavior and it's more compatible with other browsers. 676 // the same behavior and it's more compatible with other browsers.
677 selectionController().initializeSelectionState(); 677 selectionController().initializeSelectionState();
678 HitTestResult hitTestResult = EventHandlingUtil::hitTestResultInFrame( 678 HitTestResult hitTestResult = EventHandlingUtil::hitTestResultInFrame(
679 m_frame, documentPoint, HitTestRequest::ReadOnly); 679 m_frame, documentPoint, HitTestRequest::ReadOnly);
680 InputDeviceCapabilities* sourceCapabilities = 680 InputDeviceCapabilities* sourceCapabilities =
681 mouseEvent.fromTouch() 681 m_frame->document()
682 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() 682 ->domWindow()
683 : InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities(); 683 ->getInputDeviceCapabilities()
684 ->firesTouchEvents(mouseEvent.fromTouch());
685
684 if (eventResult == WebInputEventResult::NotHandled) { 686 if (eventResult == WebInputEventResult::NotHandled) {
685 eventResult = m_mouseEventManager->handleMouseFocus(hitTestResult, 687 eventResult = m_mouseEventManager->handleMouseFocus(hitTestResult,
686 sourceCapabilities); 688 sourceCapabilities);
687 } 689 }
688 m_mouseEventManager->setCapturesDragging( 690 m_mouseEventManager->setCapturesDragging(
689 eventResult == WebInputEventResult::NotHandled || mev.scrollbar()); 691 eventResult == WebInputEventResult::NotHandled || mev.scrollbar());
690 692
691 // If the hit testing originally determined the event was in a scrollbar, 693 // If the hit testing originally determined the event was in a scrollbar,
692 // refetch the MouseEventWithHitTestResults in case the scrollbar widget was 694 // refetch the MouseEventWithHitTestResults in case the scrollbar widget was
693 // destroyed when the mouse event was handled. 695 // destroyed when the mouse event was handled.
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 } 2133 }
2132 2134
2133 FrameHost* EventHandler::frameHost() const { 2135 FrameHost* EventHandler::frameHost() const {
2134 if (!m_frame->page()) 2136 if (!m_frame->page())
2135 return nullptr; 2137 return nullptr;
2136 2138
2137 return &m_frame->page()->frameHost(); 2139 return &m_frame->page()->frameHost();
2138 } 2140 }
2139 2141
2140 } // namespace blink 2142 } // 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