| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
| 30 #include "core/clipboard/DataObject.h" | 30 #include "core/clipboard/DataObject.h" |
| 31 #include "core/clipboard/DataTransferItem.h" | 31 #include "core/clipboard/DataTransferItem.h" |
| 32 #include "core/clipboard/DataTransferItemList.h" | 32 #include "core/clipboard/DataTransferItemList.h" |
| 33 #include "core/editing/markup.h" | 33 #include "core/editing/markup.h" |
| 34 #include "core/fetch/ImageResource.h" | 34 #include "core/fetch/ImageResource.h" |
| 35 #include "core/fileapi/FileList.h" | 35 #include "core/fileapi/FileList.h" |
| 36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 37 #include "core/html/HTMLImageElement.h" | 37 #include "core/html/HTMLImageElement.h" |
| 38 #include "core/layout/Layer.h" | 38 #include "core/layout/Layer.h" |
| 39 #include "core/layout/LayoutObject.h" |
| 39 #include "core/rendering/RenderImage.h" | 40 #include "core/rendering/RenderImage.h" |
| 40 #include "core/rendering/RenderObject.h" | |
| 41 #include "platform/DragImage.h" | 41 #include "platform/DragImage.h" |
| 42 #include "platform/MIMETypeRegistry.h" | 42 #include "platform/MIMETypeRegistry.h" |
| 43 #include "platform/clipboard/ClipboardMimeTypes.h" | 43 #include "platform/clipboard/ClipboardMimeTypes.h" |
| 44 #include "platform/clipboard/ClipboardUtilities.h" | 44 #include "platform/clipboard/ClipboardUtilities.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 static DragOperation convertEffectAllowedToDragOperation(const String& op) | 48 static DragOperation convertEffectAllowedToDragOperation(const String& op) |
| 49 { | 49 { |
| 50 // Values specified in http://www.whatwg.org/specs/web-apps/current-work/mul
tipage/dnd.html#dom-datatransfer-effectallowed | 50 // Values specified in http://www.whatwg.org/specs/web-apps/current-work/mul
tipage/dnd.html#dom-datatransfer-effectallowed |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 loc = m_dragLoc; | 257 loc = m_dragLoc; |
| 258 return DragImage::create(m_dragImage->image()); | 258 return DragImage::create(m_dragImage->image()); |
| 259 } | 259 } |
| 260 return nullptr; | 260 return nullptr; |
| 261 } | 261 } |
| 262 | 262 |
| 263 static ImageResource* getImageResource(Element* element) | 263 static ImageResource* getImageResource(Element* element) |
| 264 { | 264 { |
| 265 // Attempt to pull ImageResource from element | 265 // Attempt to pull ImageResource from element |
| 266 ASSERT(element); | 266 ASSERT(element); |
| 267 RenderObject* renderer = element->renderer(); | 267 LayoutObject* renderer = element->renderer(); |
| 268 if (!renderer || !renderer->isImage()) | 268 if (!renderer || !renderer->isImage()) |
| 269 return 0; | 269 return 0; |
| 270 | 270 |
| 271 RenderImage* image = toRenderImage(renderer); | 271 RenderImage* image = toRenderImage(renderer); |
| 272 if (image->cachedImage() && !image->cachedImage()->errorOccurred()) | 272 if (image->cachedImage() && !image->cachedImage()->errorOccurred()) |
| 273 return image->cachedImage(); | 273 return image->cachedImage(); |
| 274 | 274 |
| 275 return 0; | 275 return 0; |
| 276 } | 276 } |
| 277 | 277 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 531 } |
| 532 } | 532 } |
| 533 | 533 |
| 534 void DataTransfer::trace(Visitor* visitor) | 534 void DataTransfer::trace(Visitor* visitor) |
| 535 { | 535 { |
| 536 visitor->trace(m_dataObject); | 536 visitor->trace(m_dataObject); |
| 537 visitor->trace(m_dragImageElement); | 537 visitor->trace(m_dragImageElement); |
| 538 } | 538 } |
| 539 | 539 |
| 540 } // namespace blink | 540 } // namespace blink |
| OLD | NEW |