| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "core/fileapi/FileList.h" | 36 #include "core/fileapi/FileList.h" |
| 37 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
| 38 #include "core/html/HTMLImageElement.h" | 38 #include "core/html/HTMLImageElement.h" |
| 39 #include "core/html/HTMLTextFormControlElement.h" | 39 #include "core/html/HTMLTextFormControlElement.h" |
| 40 #include "core/layout/LayoutImage.h" | 40 #include "core/layout/LayoutImage.h" |
| 41 #include "core/layout/LayoutObject.h" | 41 #include "core/layout/LayoutObject.h" |
| 42 #include "platform/DragImage.h" | 42 #include "platform/DragImage.h" |
| 43 #include "platform/MIMETypeRegistry.h" | 43 #include "platform/MIMETypeRegistry.h" |
| 44 #include "platform/clipboard/ClipboardMimeTypes.h" | 44 #include "platform/clipboard/ClipboardMimeTypes.h" |
| 45 #include "platform/clipboard/ClipboardUtilities.h" | 45 #include "platform/clipboard/ClipboardUtilities.h" |
| 46 #include <memory> |
| 46 | 47 |
| 47 namespace blink { | 48 namespace blink { |
| 48 | 49 |
| 49 static DragOperation convertEffectAllowedToDragOperation(const String& op) | 50 static DragOperation convertEffectAllowedToDragOperation(const String& op) |
| 50 { | 51 { |
| 51 // Values specified in http://www.whatwg.org/specs/web-apps/current-work/mul
tipage/dnd.html#dom-datatransfer-effectallowed | 52 // Values specified in http://www.whatwg.org/specs/web-apps/current-work/mul
tipage/dnd.html#dom-datatransfer-effectallowed |
| 52 if (op == "uninitialized") | 53 if (op == "uninitialized") |
| 53 return DragOperationEvery; | 54 return DragOperationEvery; |
| 54 if (op == "none") | 55 if (op == "none") |
| 55 return DragOperationNone; | 56 return DragOperationNone; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 void DataTransfer::setDragImageResource(ImageResource* img, const IntPoint& loc) | 237 void DataTransfer::setDragImageResource(ImageResource* img, const IntPoint& loc) |
| 237 { | 238 { |
| 238 setDragImage(img, 0, loc); | 239 setDragImage(img, 0, loc); |
| 239 } | 240 } |
| 240 | 241 |
| 241 void DataTransfer::setDragImageElement(Node* node, const IntPoint& loc) | 242 void DataTransfer::setDragImageElement(Node* node, const IntPoint& loc) |
| 242 { | 243 { |
| 243 setDragImage(0, node, loc); | 244 setDragImage(0, node, loc); |
| 244 } | 245 } |
| 245 | 246 |
| 246 PassOwnPtr<DragImage> DataTransfer::createDragImage(IntPoint& loc, LocalFrame* f
rame) const | 247 std::unique_ptr<DragImage> DataTransfer::createDragImage(IntPoint& loc, LocalFra
me* frame) const |
| 247 { | 248 { |
| 248 if (m_dragImageElement) { | 249 if (m_dragImageElement) { |
| 249 loc = m_dragLoc; | 250 loc = m_dragLoc; |
| 250 | 251 |
| 251 return frame->nodeImage(*m_dragImageElement); | 252 return frame->nodeImage(*m_dragImageElement); |
| 252 } | 253 } |
| 253 if (m_dragImage) { | 254 if (m_dragImage) { |
| 254 loc = m_dragLoc; | 255 loc = m_dragLoc; |
| 255 return DragImage::create(m_dragImage->getImage()); | 256 return DragImage::create(m_dragImage->getImage()); |
| 256 } | 257 } |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 } | 510 } |
| 510 | 511 |
| 511 DEFINE_TRACE(DataTransfer) | 512 DEFINE_TRACE(DataTransfer) |
| 512 { | 513 { |
| 513 visitor->trace(m_dataObject); | 514 visitor->trace(m_dataObject); |
| 514 visitor->trace(m_dragImage); | 515 visitor->trace(m_dragImage); |
| 515 visitor->trace(m_dragImageElement); | 516 visitor->trace(m_dragImageElement); |
| 516 } | 517 } |
| 517 | 518 |
| 518 } // namespace blink | 519 } // namespace blink |
| OLD | NEW |