| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 2620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2631 FrameView* v = m_frame->view(); | 2631 FrameView* v = m_frame->view(); |
| 2632 if (!v) | 2632 if (!v) |
| 2633 return false; | 2633 return false; |
| 2634 | 2634 |
| 2635 // Clear mouse press state to avoid initiating a drag while context menu is
up. | 2635 // Clear mouse press state to avoid initiating a drag while context menu is
up. |
| 2636 m_mousePressed = false; | 2636 m_mousePressed = false; |
| 2637 LayoutPoint positionInContents = v->rootFrameToContents(event.position()); | 2637 LayoutPoint positionInContents = v->rootFrameToContents(event.position()); |
| 2638 HitTestRequest request(HitTestRequest::Active); | 2638 HitTestRequest request(HitTestRequest::Active); |
| 2639 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re
quest, positionInContents, event); | 2639 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re
quest, positionInContents, event); |
| 2640 | 2640 |
| 2641 selectionController().sendContextMenuEvent(mev, positionInContents); | 2641 selectionController().prepareForContextMenu(mev, positionInContents); |
| 2642 | 2642 |
| 2643 Node* targetNode = overrideTargetNode ? overrideTargetNode : mev.innerNode()
; | 2643 Node* targetNode = overrideTargetNode ? overrideTargetNode : mev.innerNode()
; |
| 2644 return !dispatchMouseEvent(EventTypeNames::contextmenu, targetNode, 0, event
, false); | 2644 return !dispatchMouseEvent(EventTypeNames::contextmenu, targetNode, 0, event
, false); |
| 2645 } | 2645 } |
| 2646 | 2646 |
| 2647 bool EventHandler::sendContextMenuEventForKey(Element* overrideTargetElement) | 2647 bool EventHandler::sendContextMenuEventForKey(Element* overrideTargetElement) |
| 2648 { | 2648 { |
| 2649 FrameView* view = m_frame->view(); | 2649 FrameView* view = m_frame->view(); |
| 2650 if (!view) | 2650 if (!view) |
| 2651 return false; | 2651 return false; |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3838 | 3838 |
| 3839 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) | 3839 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) |
| 3840 { | 3840 { |
| 3841 m_mousePositionIsUnknown = false; | 3841 m_mousePositionIsUnknown = false; |
| 3842 m_lastKnownMousePosition = event.position(); | 3842 m_lastKnownMousePosition = event.position(); |
| 3843 m_lastKnownMouseGlobalPosition = event.globalPosition(); | 3843 m_lastKnownMouseGlobalPosition = event.globalPosition(); |
| 3844 } | 3844 } |
| 3845 | 3845 |
| 3846 bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& m
ev, LocalFrame* subframe) | 3846 bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& m
ev, LocalFrame* subframe) |
| 3847 { | 3847 { |
| 3848 selectionController().passMousePressEventToSubframe(mev); | 3848 selectionController().preparePassMousePressEventToSubframe(mev); |
| 3849 subframe->eventHandler().handleMousePressEvent(mev.event()); | 3849 subframe->eventHandler().handleMousePressEvent(mev.event()); |
| 3850 return true; | 3850 return true; |
| 3851 } | 3851 } |
| 3852 | 3852 |
| 3853 bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& me
v, LocalFrame* subframe, HitTestResult* hoveredNode) | 3853 bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& me
v, LocalFrame* subframe, HitTestResult* hoveredNode) |
| 3854 { | 3854 { |
| 3855 if (m_mouseDownMayStartDrag) | 3855 if (m_mouseDownMayStartDrag) |
| 3856 return false; | 3856 return false; |
| 3857 subframe->eventHandler().handleMouseMoveOrLeaveEvent(mev.event(), hoveredNod
e); | 3857 subframe->eventHandler().handleMouseMoveOrLeaveEvent(mev.event(), hoveredNod
e); |
| 3858 return true; | 3858 return true; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3890 unsigned EventHandler::accessKeyModifiers() | 3890 unsigned EventHandler::accessKeyModifiers() |
| 3891 { | 3891 { |
| 3892 #if OS(MACOSX) | 3892 #if OS(MACOSX) |
| 3893 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3893 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3894 #else | 3894 #else |
| 3895 return PlatformEvent::AltKey; | 3895 return PlatformEvent::AltKey; |
| 3896 #endif | 3896 #endif |
| 3897 } | 3897 } |
| 3898 | 3898 |
| 3899 } // namespace blink | 3899 } // namespace blink |
| OLD | NEW |