| 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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 if (!dragImage) { | 800 if (!dragImage) { |
| 801 FontRenderingMode renderingMode = src->settings() ? src->settings()-
>fontRenderingMode() : NormalRenderingMode; | 801 FontRenderingMode renderingMode = src->settings() ? src->settings()-
>fontRenderingMode() : NormalRenderingMode; |
| 802 float deviceScaleFactor = src->page() ? src->page()->deviceScaleFact
or() : 1; | 802 float deviceScaleFactor = src->page() ? src->page()->deviceScaleFact
or() : 1; |
| 803 dragImage = createDragImageForLink(linkURL, hitTestResult.textConten
t(), renderingMode, deviceScaleFactor); | 803 dragImage = createDragImageForLink(linkURL, hitTestResult.textConten
t(), renderingMode, deviceScaleFactor); |
| 804 IntSize size = dragImageSize(dragImage); | 804 IntSize size = dragImageSize(dragImage); |
| 805 m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset); | 805 m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset); |
| 806 dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDr
aggedPoint.y() + m_dragOffset.y()); | 806 dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDr
aggedPoint.y() + m_dragOffset.y()); |
| 807 } | 807 } |
| 808 doSystemDrag(dragImage, dragLoc, mouseDraggedPoint, clipboard, src, true
); | 808 doSystemDrag(dragImage, dragLoc, mouseDraggedPoint, clipboard, src, true
); |
| 809 } else if (state.m_dragType == DragSourceActionDHTML) { | 809 } else if (state.m_dragType == DragSourceActionDHTML) { |
| 810 ASSERT(m_dragSourceAction & DragSourceActionDHTML); | 810 if (dragImage) { |
| 811 doSystemDrag(dragImage, dragLoc, dragOrigin, clipboard, src, false); | 811 ASSERT(m_dragSourceAction & DragSourceActionDHTML); |
| 812 doSystemDrag(dragImage, dragLoc, dragOrigin, clipboard, src, false); |
| 813 } else { |
| 814 startedDrag = false; |
| 815 } |
| 812 } else { | 816 } else { |
| 813 // draggableNode() determined an image or link node was draggable, but i
t turns out the | 817 // draggableNode() determined an image or link node was draggable, but i
t turns out the |
| 814 // image or link had no URL, so there is nothing to drag. | 818 // image or link had no URL, so there is nothing to drag. |
| 815 startedDrag = false; | 819 startedDrag = false; |
| 816 } | 820 } |
| 817 | 821 |
| 818 if (dragImage) | 822 if (dragImage) |
| 819 deleteDragImage(dragImage); | 823 deleteDragImage(dragImage); |
| 820 return startedDrag; | 824 return startedDrag; |
| 821 } | 825 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 #endif | 921 #endif |
| 918 return maxDragImageSize; | 922 return maxDragImageSize; |
| 919 } | 923 } |
| 920 | 924 |
| 921 void DragController::cleanupAfterSystemDrag() | 925 void DragController::cleanupAfterSystemDrag() |
| 922 { | 926 { |
| 923 } | 927 } |
| 924 | 928 |
| 925 } // namespace WebCore | 929 } // namespace WebCore |
| 926 | 930 |
| OLD | NEW |