| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void DragClientImpl::startDrag(DragImage* dragImage, | 62 void DragClientImpl::startDrag(DragImage* dragImage, |
| 63 const IntPoint& dragImageOrigin, | 63 const IntPoint& dragImageOrigin, |
| 64 const IntPoint& eventPos, | 64 const IntPoint& eventPos, |
| 65 Clipboard* clipboard, | 65 Clipboard* clipboard, |
| 66 Frame* frame, | 66 Frame* frame, |
| 67 bool isLinkDrag) | 67 bool isLinkDrag) |
| 68 { | 68 { |
| 69 // Add a ref to the frame just in case a load occurs mid-drag. | 69 // Add a ref to the frame just in case a load occurs mid-drag. |
| 70 RefPtr<Frame> frameProtector = frame; | 70 RefPtr<Frame> frameProtector = frame; |
| 71 | 71 |
| 72 WebDragData dragData = clipboard->dataObject(); | 72 WebDragData dragData(clipboard->dataObject()); |
| 73 WebDragOperationsMask dragOperationMask = static_cast<WebDragOperationsMask>
(clipboard->sourceOperation()); | 73 WebDragOperationsMask dragOperationMask = static_cast<WebDragOperationsMask>
(clipboard->sourceOperation()); |
| 74 WebImage image; | 74 WebImage image; |
| 75 IntSize offsetSize(eventPos - dragImageOrigin); | 75 IntSize offsetSize(eventPos - dragImageOrigin); |
| 76 WebPoint offsetPoint(offsetSize.width(), offsetSize.height()); | 76 WebPoint offsetPoint(offsetSize.width(), offsetSize.height()); |
| 77 | 77 |
| 78 if (dragImage) { | 78 if (dragImage) { |
| 79 float resolutionScale = dragImage->resolutionScale(); | 79 float resolutionScale = dragImage->resolutionScale(); |
| 80 if (m_webView->deviceScaleFactor() != resolutionScale) { | 80 if (m_webView->deviceScaleFactor() != resolutionScale) { |
| 81 ASSERT(resolutionScale > 0); | 81 ASSERT(resolutionScale > 0); |
| 82 float scale = m_webView->deviceScaleFactor() / resolutionScale; | 82 float scale = m_webView->deviceScaleFactor() / resolutionScale; |
| 83 dragImage->scale(scale, scale); | 83 dragImage->scale(scale, scale); |
| 84 } | 84 } |
| 85 image = dragImage->bitmap(); | 85 image = dragImage->bitmap(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 m_webView->startDragging(frame, dragData, dragOperationMask, image, offsetPo
int); | 88 m_webView->startDragging(frame, dragData, dragOperationMask, image, offsetPo
int); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| OLD | NEW |