| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Google Inc. | 3 * Copyright (C) 2008 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "core/page/DragController.h" | 27 #include "core/page/DragController.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 29 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
| 31 #include "core/InputTypeNames.h" | 31 #include "core/InputTypeNames.h" |
| 32 #include "core/clipboard/DataObject.h" | 32 #include "core/clipboard/DataObject.h" |
| 33 #include "core/clipboard/DataTransfer.h" | 33 #include "core/clipboard/DataTransfer.h" |
| 34 #include "core/clipboard/DataTransferAccessPolicy.h" | 34 #include "core/clipboard/DataTransferAccessPolicy.h" |
| 35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 36 #include "core/dom/DocumentFragment.h" | 36 #include "core/dom/DocumentFragment.h" |
| 37 #include "core/dom/DocumentUserGestureToken.h" |
| 37 #include "core/dom/Element.h" | 38 #include "core/dom/Element.h" |
| 38 #include "core/dom/Node.h" | 39 #include "core/dom/Node.h" |
| 39 #include "core/dom/Text.h" | 40 #include "core/dom/Text.h" |
| 40 #include "core/dom/shadow/ShadowRoot.h" | 41 #include "core/dom/shadow/ShadowRoot.h" |
| 41 #include "core/editing/DragCaretController.h" | 42 #include "core/editing/DragCaretController.h" |
| 42 #include "core/editing/EditingUtilities.h" | 43 #include "core/editing/EditingUtilities.h" |
| 43 #include "core/editing/Editor.h" | 44 #include "core/editing/Editor.h" |
| 44 #include "core/editing/FrameSelection.h" | 45 #include "core/editing/FrameSelection.h" |
| 45 #include "core/editing/commands/DragAndDropCommand.h" | 46 #include "core/editing/commands/DragAndDropCommand.h" |
| 46 #include "core/editing/serializers/Serialization.h" | 47 #include "core/editing/serializers/Serialization.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 235 } |
| 235 | 236 |
| 236 DragSession DragController::dragUpdated(DragData* dragData) { | 237 DragSession DragController::dragUpdated(DragData* dragData) { |
| 237 return dragEnteredOrUpdated(dragData); | 238 return dragEnteredOrUpdated(dragData); |
| 238 } | 239 } |
| 239 | 240 |
| 240 bool DragController::performDrag(DragData* dragData) { | 241 bool DragController::performDrag(DragData* dragData) { |
| 241 DCHECK(dragData); | 242 DCHECK(dragData); |
| 242 m_documentUnderMouse = m_page->deprecatedLocalMainFrame()->documentAtPoint( | 243 m_documentUnderMouse = m_page->deprecatedLocalMainFrame()->documentAtPoint( |
| 243 dragData->clientPosition()); | 244 dragData->clientPosition()); |
| 245 UserGestureIndicator gesture(DocumentUserGestureToken::create( |
| 246 m_documentUnderMouse, UserGestureToken::NewGesture)); |
| 244 if ((m_dragDestinationAction & DragDestinationActionDHTML) && | 247 if ((m_dragDestinationAction & DragDestinationActionDHTML) && |
| 245 m_documentIsHandlingDrag) { | 248 m_documentIsHandlingDrag) { |
| 246 LocalFrame* mainFrame = m_page->deprecatedLocalMainFrame(); | 249 LocalFrame* mainFrame = m_page->deprecatedLocalMainFrame(); |
| 247 bool preventedDefault = false; | 250 bool preventedDefault = false; |
| 248 if (mainFrame->view()) { | 251 if (mainFrame->view()) { |
| 249 // Sending an event can result in the destruction of the view and part. | 252 // Sending an event can result in the destruction of the view and part. |
| 250 DataTransfer* dataTransfer = | 253 DataTransfer* dataTransfer = |
| 251 createDraggingDataTransfer(DataTransferReadable, dragData); | 254 createDraggingDataTransfer(DataTransferReadable, dragData); |
| 252 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask()); | 255 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask()); |
| 253 EventHandler& eventHandler = mainFrame->eventHandler(); | 256 EventHandler& eventHandler = mainFrame->eventHandler(); |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 } | 1214 } |
| 1212 | 1215 |
| 1213 DEFINE_TRACE(DragController) { | 1216 DEFINE_TRACE(DragController) { |
| 1214 visitor->trace(m_page); | 1217 visitor->trace(m_page); |
| 1215 visitor->trace(m_documentUnderMouse); | 1218 visitor->trace(m_documentUnderMouse); |
| 1216 visitor->trace(m_dragInitiator); | 1219 visitor->trace(m_dragInitiator); |
| 1217 visitor->trace(m_fileInputElementUnderMouse); | 1220 visitor->trace(m_fileInputElementUnderMouse); |
| 1218 } | 1221 } |
| 1219 | 1222 |
| 1220 } // namespace blink | 1223 } // namespace blink |
| OLD | NEW |