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 3016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3027 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.globa lPosition(), | 3027 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.globa lPosition(), |
3028 NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0, | 3028 NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0, |
3029 static_cast<PlatformEvent::Modifiers>(modifiers), | 3029 static_cast<PlatformEvent::Modifiers>(modifiers), |
3030 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse); | 3030 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse); |
3031 dispatchMouseEvent(EventTypeNames::mousemove, targetedEvent.hitTestResult(). innerNode(), 0, fakeMouseMove); | 3031 dispatchMouseEvent(EventTypeNames::mousemove, targetedEvent.hitTestResult(). innerNode(), 0, fakeMouseMove); |
3032 | 3032 |
3033 PlatformEvent::Type eventType = PlatformEvent::MousePressed; | 3033 PlatformEvent::Type eventType = PlatformEvent::MousePressed; |
3034 | 3034 |
3035 if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) | 3035 if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) |
3036 eventType = PlatformEvent::MouseReleased; | 3036 eventType = PlatformEvent::MouseReleased; |
3037 else | |
3038 modifiers |= PlatformEvent::RightButtonDown; | |
3039 | 3037 |
3038 // Always set right button down as we are sending mousedown event regardless | |
3039 modifiers |= PlatformEvent::RightButtonDown; | |
3040 | |
3041 // TODO(nzolghadr): crbug.com/579564 Maybe we should not send mouse down at all | |
mustaq
2016/01/20 18:10:26
Please consider using "TODO(crbug.com/579564)" sin
Navid Zolghadr
2016/01/20 18:35:52
Done.
| |
3040 PlatformMouseEvent mouseEvent(targetedEvent.event().position(), targetedEven t.event().globalPosition(), RightButton, eventType, 1, | 3042 PlatformMouseEvent mouseEvent(targetedEvent.event().position(), targetedEven t.event().globalPosition(), RightButton, eventType, 1, |
3041 static_cast<PlatformEvent::Modifiers>(modifiers), | 3043 static_cast<PlatformEvent::Modifiers>(modifiers), |
3042 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), WebPo interProperties::PointerType::Mouse); | 3044 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), WebPo interProperties::PointerType::Mouse); |
3043 // To simulate right-click behavior, we send a right mouse down and then | 3045 // To simulate right-click behavior, we send a right mouse down and then |
3044 // context menu event. | 3046 // context menu event. |
3045 // FIXME: Send HitTestResults to avoid redundant hit tests. | 3047 // FIXME: Send HitTestResults to avoid redundant hit tests. |
3046 handleMousePressEvent(mouseEvent); | 3048 handleMousePressEvent(mouseEvent); |
3047 return sendContextMenuEvent(mouseEvent); | 3049 return sendContextMenuEvent(mouseEvent); |
3048 // We do not need to send a corresponding mouse release because in case of | 3050 // We do not need to send a corresponding mouse release because in case of |
3049 // right-click, the context menu takes capture and consumes all events. | 3051 // right-click, the context menu takes capture and consumes all events. |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4144 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 4146 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
4145 { | 4147 { |
4146 #if OS(MACOSX) | 4148 #if OS(MACOSX) |
4147 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); | 4149 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); |
4148 #else | 4150 #else |
4149 return PlatformEvent::AltKey; | 4151 return PlatformEvent::AltKey; |
4150 #endif | 4152 #endif |
4151 } | 4153 } |
4152 | 4154 |
4153 } // namespace blink | 4155 } // namespace blink |
OLD | NEW |