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