| 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> | |
| 47 | 46 |
| 48 namespace blink { | 47 namespace blink { |
| 49 | 48 |
| 50 static DragOperation convertEffectAllowedToDragOperation(const String& op) | 49 static DragOperation convertEffectAllowedToDragOperation(const String& op) |
| 51 { | 50 { |
| 52 // Values specified in http://www.whatwg.org/specs/web-apps/current-work/mul
tipage/dnd.html#dom-datatransfer-effectallowed | 51 // Values specified in http://www.whatwg.org/specs/web-apps/current-work/mul
tipage/dnd.html#dom-datatransfer-effectallowed |
| 53 if (op == "uninitialized") | 52 if (op == "uninitialized") |
| 54 return DragOperationEvery; | 53 return DragOperationEvery; |
| 55 if (op == "none") | 54 if (op == "none") |
| 56 return DragOperationNone; | 55 return DragOperationNone; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 void DataTransfer::setDragImageResource(ImageResource* img, const IntPoint& loc) | 236 void DataTransfer::setDragImageResource(ImageResource* img, const IntPoint& loc) |
| 238 { | 237 { |
| 239 setDragImage(img, 0, loc); | 238 setDragImage(img, 0, loc); |
| 240 } | 239 } |
| 241 | 240 |
| 242 void DataTransfer::setDragImageElement(Node* node, const IntPoint& loc) | 241 void DataTransfer::setDragImageElement(Node* node, const IntPoint& loc) |
| 243 { | 242 { |
| 244 setDragImage(0, node, loc); | 243 setDragImage(0, node, loc); |
| 245 } | 244 } |
| 246 | 245 |
| 247 std::unique_ptr<DragImage> DataTransfer::createDragImage(IntPoint& loc, LocalFra
me* frame) const | 246 PassOwnPtr<DragImage> DataTransfer::createDragImage(IntPoint& loc, LocalFrame* f
rame) const |
| 248 { | 247 { |
| 249 if (m_dragImageElement) { | 248 if (m_dragImageElement) { |
| 250 loc = m_dragLoc; | 249 loc = m_dragLoc; |
| 251 | 250 |
| 252 return frame->nodeImage(*m_dragImageElement); | 251 return frame->nodeImage(*m_dragImageElement); |
| 253 } | 252 } |
| 254 if (m_dragImage) { | 253 if (m_dragImage) { |
| 255 loc = m_dragLoc; | 254 loc = m_dragLoc; |
| 256 return DragImage::create(m_dragImage->getImage()); | 255 return DragImage::create(m_dragImage->getImage()); |
| 257 } | 256 } |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 } | 509 } |
| 511 | 510 |
| 512 DEFINE_TRACE(DataTransfer) | 511 DEFINE_TRACE(DataTransfer) |
| 513 { | 512 { |
| 514 visitor->trace(m_dataObject); | 513 visitor->trace(m_dataObject); |
| 515 visitor->trace(m_dragImage); | 514 visitor->trace(m_dragImage); |
| 516 visitor->trace(m_dragImageElement); | 515 visitor->trace(m_dragImageElement); |
| 517 } | 516 } |
| 518 | 517 |
| 519 } // namespace blink | 518 } // namespace blink |
| OLD | NEW |