| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 m_doingDragAndDrop = true; | 170 m_doingDragAndDrop = true; |
| 171 client()->startDragging(policy, data, mask, dragImage, dragImageOffset); | 171 client()->startDragging(policy, data, mask, dragImage, dragImageOffset); |
| 172 } | 172 } |
| 173 | 173 |
| 174 WebDragOperation WebFrameWidgetBase::dragTargetDragEnterOrOver( | 174 WebDragOperation WebFrameWidgetBase::dragTargetDragEnterOrOver( |
| 175 const WebPoint& pointInViewport, | 175 const WebPoint& pointInViewport, |
| 176 const WebPoint& screenPoint, | 176 const WebPoint& screenPoint, |
| 177 DragAction dragAction, | 177 DragAction dragAction, |
| 178 int modifiers) { | 178 int modifiers) { |
| 179 DCHECK(m_currentDragData); | 179 DCHECK(m_currentDragData); |
| 180 if (ignoreInputEvents()) { | 180 // TODO(paulmeyer): It shouldn't be possible for |m_currentDragData| to be |
| 181 // null here, but this is somehow happening (rarely). This suggests that in |
| 182 // some cases drag-over is happening before drag-enter, which should be |
| 183 // impossible. This needs to be investigated further. Once fixed, the extra |
| 184 // check for |!m_currentDragData| should be removed. (crbug.com/671504) |
| 185 if (ignoreInputEvents() || !m_currentDragData) { |
| 181 cancelDrag(); | 186 cancelDrag(); |
| 182 return WebDragOperationNone; | 187 return WebDragOperationNone; |
| 183 } | 188 } |
| 184 | 189 |
| 185 WebPoint pointInRootFrame(viewportToRootFrame(pointInViewport)); | 190 WebPoint pointInRootFrame(viewportToRootFrame(pointInViewport)); |
| 186 | 191 |
| 187 m_currentDragData->setModifiers(modifiers); | 192 m_currentDragData->setModifiers(modifiers); |
| 188 DragData dragData(m_currentDragData.get(), pointInRootFrame, screenPoint, | 193 DragData dragData(m_currentDragData.get(), pointInRootFrame, screenPoint, |
| 189 static_cast<DragOperation>(m_operationsAllowed)); | 194 static_cast<DragOperation>(m_operationsAllowed)); |
| 190 | 195 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 212 | 217 |
| 213 WebViewImpl* WebFrameWidgetBase::view() const { | 218 WebViewImpl* WebFrameWidgetBase::view() const { |
| 214 return toWebLocalFrameImpl(localRoot())->viewImpl(); | 219 return toWebLocalFrameImpl(localRoot())->viewImpl(); |
| 215 } | 220 } |
| 216 | 221 |
| 217 Page* WebFrameWidgetBase::page() const { | 222 Page* WebFrameWidgetBase::page() const { |
| 218 return view()->page(); | 223 return view()->page(); |
| 219 } | 224 } |
| 220 | 225 |
| 221 } // namespace blink | 226 } // namespace blink |
| OLD | NEW |