OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "web/WebFrameWidgetBase.h" | 5 #include "web/WebFrameWidgetBase.h" |
6 | 6 |
7 #include "core/frame/FrameHost.h" | 7 #include "core/frame/FrameHost.h" |
8 #include "core/frame/VisualViewport.h" | 8 #include "core/frame/VisualViewport.h" |
9 #include "core/input/EventHandler.h" | 9 #include "core/input/EventHandler.h" |
10 #include "core/page/DragActions.h" | 10 #include "core/page/DragActions.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 m_currentDragData = nullptr; | 124 m_currentDragData = nullptr; |
125 } | 125 } |
126 | 126 |
127 void WebFrameWidgetBase::dragSourceEndedAt(const WebPoint& pointInViewport, | 127 void WebFrameWidgetBase::dragSourceEndedAt(const WebPoint& pointInViewport, |
128 const WebPoint& screenPoint, | 128 const WebPoint& screenPoint, |
129 WebDragOperation operation) { | 129 WebDragOperation operation) { |
130 if (ignoreInputEvents()) { | 130 if (ignoreInputEvents()) { |
131 cancelDrag(); | 131 cancelDrag(); |
132 return; | 132 return; |
133 } | 133 } |
134 WebPoint pointInRootFrame( | 134 WebFloatPoint pointInRootFrame( |
135 page()->frameHost().visualViewport().viewportToRootFrame( | 135 page()->frameHost().visualViewport().viewportToRootFrame( |
136 pointInViewport)); | 136 pointInViewport)); |
137 PlatformMouseEvent pme( | 137 |
138 pointInRootFrame, screenPoint, WebPointerProperties::Button::Left, | 138 WebMouseEvent fakeMouseMove(WebInputEvent::MouseMove, pointInRootFrame, |
139 PlatformEvent::MouseMoved, 0, PlatformEvent::NoModifiers, | 139 WebFloatPoint(screenPoint.x, screenPoint.y), |
140 PlatformMouseEvent::RealOrIndistinguishable, TimeTicks::Now()); | 140 WebPointerProperties::Button::Left, 0, |
| 141 PlatformEvent::NoModifiers, |
| 142 TimeTicks::Now().InSeconds()); |
| 143 fakeMouseMove.setFrameScale(1); |
141 toCoreFrame(localRoot()) | 144 toCoreFrame(localRoot()) |
142 ->eventHandler() | 145 ->eventHandler() |
143 .dragSourceEndedAt(pme, static_cast<DragOperation>(operation)); | 146 .dragSourceEndedAt(fakeMouseMove, static_cast<DragOperation>(operation)); |
144 } | 147 } |
145 | 148 |
146 void WebFrameWidgetBase::dragSourceSystemDragEnded() { | 149 void WebFrameWidgetBase::dragSourceSystemDragEnded() { |
147 cancelDrag(); | 150 cancelDrag(); |
148 } | 151 } |
149 | 152 |
150 void WebFrameWidgetBase::cancelDrag() { | 153 void WebFrameWidgetBase::cancelDrag() { |
151 // It's possible for us this to be callback while we're not doing a drag if | 154 // It's possible for us this to be callback while we're not doing a drag if |
152 // it's from a previous page that got unloaded. | 155 // it's from a previous page that got unloaded. |
153 if (!m_doingDragAndDrop) | 156 if (!m_doingDragAndDrop) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 209 |
207 WebViewImpl* WebFrameWidgetBase::view() const { | 210 WebViewImpl* WebFrameWidgetBase::view() const { |
208 return toWebLocalFrameImpl(localRoot())->viewImpl(); | 211 return toWebLocalFrameImpl(localRoot())->viewImpl(); |
209 } | 212 } |
210 | 213 |
211 Page* WebFrameWidgetBase::page() const { | 214 Page* WebFrameWidgetBase::page() const { |
212 return view()->page(); | 215 return view()->page(); |
213 } | 216 } |
214 | 217 |
215 } // namespace blink | 218 } // namespace blink |
OLD | NEW |