| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction
, dragSession); | 296 m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction
, dragSession); |
| 297 if (!m_documentIsHandlingDrag && (m_dragDestinationAction & DragDestinationA
ctionLoad)) | 297 if (!m_documentIsHandlingDrag && (m_dragDestinationAction & DragDestinationA
ctionLoad)) |
| 298 dragSession.operation = operationForLoad(dragData); | 298 dragSession.operation = operationForLoad(dragData); |
| 299 return dragSession; | 299 return dragSession; |
| 300 } | 300 } |
| 301 | 301 |
| 302 static HTMLInputElement* asFileInput(Node* node) | 302 static HTMLInputElement* asFileInput(Node* node) |
| 303 { | 303 { |
| 304 ASSERT(node); | 304 ASSERT(node); |
| 305 for (; node; node = node->shadowHost()) { | 305 for (; node; node = node->shadowHost()) { |
| 306 if (node->hasTagName(HTMLNames::inputTag) && toHTMLInputElement(node)->i
sFileUpload()) | 306 if (isHTMLInputElement(*node) && toHTMLInputElement(node)->isFileUpload(
)) |
| 307 return toHTMLInputElement(node); | 307 return toHTMLInputElement(node); |
| 308 } | 308 } |
| 309 return 0; | 309 return 0; |
| 310 } | 310 } |
| 311 | 311 |
| 312 // This can return null if an empty document is loaded. | 312 // This can return null if an empty document is loaded. |
| 313 static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint&
p) | 313 static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint&
p) |
| 314 { | 314 { |
| 315 LocalFrame* frame = documentUnderMouse->frame(); | 315 LocalFrame* frame = documentUnderMouse->frame(); |
| 316 float zoomFactor = frame ? frame->pageZoomFactor() : 1; | 316 float zoomFactor = frame ? frame->pageZoomFactor() : 1; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 if (dragMode == DRAG_NONE) | 648 if (dragMode == DRAG_NONE) |
| 649 continue; | 649 continue; |
| 650 // Even if the image is part of a selection, we always only drag the
image in this case. | 650 // Even if the image is part of a selection, we always only drag the
image in this case. |
| 651 if (renderer->isImage() | 651 if (renderer->isImage() |
| 652 && src->settings() | 652 && src->settings() |
| 653 && src->settings()->loadsImagesAutomatically()) { | 653 && src->settings()->loadsImagesAutomatically()) { |
| 654 dragType = DragSourceActionImage; | 654 dragType = DragSourceActionImage; |
| 655 return node; | 655 return node; |
| 656 } | 656 } |
| 657 // Other draggable elements are considered unselectable. | 657 // Other draggable elements are considered unselectable. |
| 658 if (node->hasTagName(HTMLNames::aTag) && toHTMLAnchorElement(node)->
isLiveLink()) { | 658 if (isHTMLAnchorElement(*node) && toHTMLAnchorElement(node)->isLiveL
ink()) { |
| 659 candidateDragType = DragSourceActionLink; | 659 candidateDragType = DragSourceActionLink; |
| 660 break; | 660 break; |
| 661 } | 661 } |
| 662 if (dragMode == DRAG_ELEMENT) { | 662 if (dragMode == DRAG_ELEMENT) { |
| 663 candidateDragType = DragSourceActionDHTML; | 663 candidateDragType = DragSourceActionDHTML; |
| 664 break; | 664 break; |
| 665 } | 665 } |
| 666 } | 666 } |
| 667 } | 667 } |
| 668 | 668 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 return keyState & PlatformEvent::CtrlKey; | 959 return keyState & PlatformEvent::CtrlKey; |
| 960 #endif | 960 #endif |
| 961 } | 961 } |
| 962 | 962 |
| 963 void DragController::cleanupAfterSystemDrag() | 963 void DragController::cleanupAfterSystemDrag() |
| 964 { | 964 { |
| 965 } | 965 } |
| 966 | 966 |
| 967 } // namespace WebCore | 967 } // namespace WebCore |
| 968 | 968 |
| OLD | NEW |