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/LayoutImage.h" |
39 #include "core/layout/LayoutObject.h" | 40 #include "core/layout/LayoutObject.h" |
40 #include "core/rendering/RenderImage.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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 LayoutObject* 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 LayoutImage* image = toLayoutImage(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 |
278 static void writeImageToDataObject(DataObject* dataObject, Element* element, con
st KURL& url) | 278 static void writeImageToDataObject(DataObject* dataObject, Element* element, con
st KURL& url) |
279 { | 279 { |
280 // Shove image data into a DataObject for use as a file | 280 // Shove image data into a DataObject for use as a file |
281 ImageResource* cachedImage = getImageResource(element); | 281 ImageResource* cachedImage = getImageResource(element); |
(...skipping 249 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 |