OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "core/frame/FrameView.h" | 28 #include "core/frame/FrameView.h" |
29 #include "core/frame/LocalFrame.h" | 29 #include "core/frame/LocalFrame.h" |
30 #include "core/rendering/RenderLayer.h" | 30 #include "core/rendering/RenderLayer.h" |
31 #include "core/rendering/RenderObject.h" | 31 #include "core/rendering/RenderObject.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 MouseRelatedEvent::MouseRelatedEvent() | 35 MouseRelatedEvent::MouseRelatedEvent() |
36 : m_isSimulated(false) | 36 : m_isSimulated(false) |
37 , m_hasCachedRelativePosition(false) | 37 , m_hasCachedRelativePosition(false) |
| 38 , m_derivesFromTouch(false) |
38 { | 39 { |
39 } | 40 } |
40 | 41 |
41 static LayoutSize contentsScrollOffset(AbstractView* abstractView) | 42 static LayoutSize contentsScrollOffset(AbstractView* abstractView) |
42 { | 43 { |
43 if (!abstractView) | 44 if (!abstractView) |
44 return LayoutSize(); | 45 return LayoutSize(); |
45 LocalFrame* frame = abstractView->frame(); | 46 LocalFrame* frame = abstractView->frame(); |
46 if (!frame) | 47 if (!frame) |
47 return LayoutSize(); | 48 return LayoutSize(); |
48 FrameView* frameView = frame->view(); | 49 FrameView* frameView = frame->view(); |
49 if (!frameView) | 50 if (!frameView) |
50 return LayoutSize(); | 51 return LayoutSize(); |
51 float scaleFactor = frame->pageZoomFactor(); | 52 float scaleFactor = frame->pageZoomFactor(); |
52 return LayoutSize(frameView->scrollX() / scaleFactor, frameView->scrollY() /
scaleFactor); | 53 return LayoutSize(frameView->scrollX() / scaleFactor, frameView->scrollY() /
scaleFactor); |
53 } | 54 } |
54 | 55 |
55 MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubb
le, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> abstractView, | 56 MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubb
le, bool cancelable, |
56 int detail, const IntPoint& screenLocation,
const IntPoint& windowLocation, | 57 PassRefPtrWillBeRawPtr<AbstractView> abstractView, int detail, const IntPoin
t& screenLocation, |
57 const IntPoint& movementDelta, | 58 const IntPoint& windowLocation, const IntPoint& movementDelta, bool ctrlKey,
bool altKey, |
58 bool ctrlKey, bool altKey, bool shiftKey, b
ool metaKey, bool isSimulated) | 59 bool shiftKey, bool metaKey, bool isSimulated, bool derivesFromTouch) |
59 : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail
, ctrlKey, altKey, shiftKey, metaKey) | 60 : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail
, ctrlKey, altKey, shiftKey, metaKey) |
60 , m_screenLocation(screenLocation) | 61 , m_screenLocation(screenLocation) |
61 , m_movementDelta(movementDelta) | 62 , m_movementDelta(movementDelta) |
62 , m_isSimulated(isSimulated) | 63 , m_isSimulated(isSimulated) |
| 64 , m_derivesFromTouch(derivesFromTouch) |
63 { | 65 { |
64 LayoutPoint adjustedPageLocation; | 66 LayoutPoint adjustedPageLocation; |
65 LayoutPoint scrollPosition; | 67 LayoutPoint scrollPosition; |
66 | 68 |
67 LocalFrame* frame = view() ? view()->frame() : 0; | 69 LocalFrame* frame = view() ? view()->frame() : 0; |
68 if (frame && !isSimulated) { | 70 if (frame && !isSimulated) { |
69 if (FrameView* frameView = frame->view()) { | 71 if (FrameView* frameView = frame->view()) { |
70 scrollPosition = frameView->scrollPosition(); | 72 scrollPosition = frameView->scrollPosition(); |
71 adjustedPageLocation = frameView->windowToContents(windowLocation); | 73 adjustedPageLocation = frameView->windowToContents(windowLocation); |
72 float scaleFactor = 1 / frame->pageZoomFactor(); | 74 float scaleFactor = 1 / frame->pageZoomFactor(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events
.html>. | 226 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events
.html>. |
225 return m_clientLocation.y(); | 227 return m_clientLocation.y(); |
226 } | 228 } |
227 | 229 |
228 void MouseRelatedEvent::trace(Visitor* visitor) | 230 void MouseRelatedEvent::trace(Visitor* visitor) |
229 { | 231 { |
230 UIEventWithKeyState::trace(visitor); | 232 UIEventWithKeyState::trace(visitor); |
231 } | 233 } |
232 | 234 |
233 } // namespace blink | 235 } // namespace blink |
OLD | NEW |