OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Google Inc. | 3 * Copyright (C) 2008 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 return nullptr; | 692 return nullptr; |
693 LayoutImage* image = toLayoutImage(layoutObject); | 693 LayoutImage* image = toLayoutImage(layoutObject); |
694 return image->cachedImage(); | 694 return image->cachedImage(); |
695 } | 695 } |
696 | 696 |
697 static Image* getImage(Element* element) | 697 static Image* getImage(Element* element) |
698 { | 698 { |
699 ASSERT(element); | 699 ASSERT(element); |
700 ImageResource* cachedImage = getImageResource(element); | 700 ImageResource* cachedImage = getImageResource(element); |
701 return (cachedImage && !cachedImage->errorOccurred()) ? | 701 return (cachedImage && !cachedImage->errorOccurred()) ? |
702 cachedImage->image() : nullptr; | 702 cachedImage->getImage() : nullptr; |
703 } | 703 } |
704 | 704 |
705 static void prepareDataTransferForImageDrag(LocalFrame* source, DataTransfer* da
taTransfer, Element* node, const KURL& linkURL, const KURL& imageURL, const Stri
ng& label) | 705 static void prepareDataTransferForImageDrag(LocalFrame* source, DataTransfer* da
taTransfer, Element* node, const KURL& linkURL, const KURL& imageURL, const Stri
ng& label) |
706 { | 706 { |
707 if (node->isContentRichlyEditable()) { | 707 if (node->isContentRichlyEditable()) { |
708 RefPtrWillBeRawPtr<Range> range = source->document()->createRange(); | 708 RefPtrWillBeRawPtr<Range> range = source->document()->createRange(); |
709 range->selectNode(node, ASSERT_NO_EXCEPTION); | 709 range->selectNode(node, ASSERT_NO_EXCEPTION); |
710 source->selection().setSelection(VisibleSelection(EphemeralRange(range.g
et()))); | 710 source->selection().setSelection(VisibleSelection(EphemeralRange(range.g
et()))); |
711 } | 711 } |
712 dataTransfer->declareAndWriteDragImage(node, !linkURL.isEmpty() ? linkURL :
imageURL, label); | 712 dataTransfer->declareAndWriteDragImage(node, !linkURL.isEmpty() ? linkURL :
imageURL, label); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 | 973 |
974 DEFINE_TRACE(DragController) | 974 DEFINE_TRACE(DragController) |
975 { | 975 { |
976 visitor->trace(m_page); | 976 visitor->trace(m_page); |
977 visitor->trace(m_documentUnderMouse); | 977 visitor->trace(m_documentUnderMouse); |
978 visitor->trace(m_dragInitiator); | 978 visitor->trace(m_dragInitiator); |
979 visitor->trace(m_fileInputElementUnderMouse); | 979 visitor->trace(m_fileInputElementUnderMouse); |
980 } | 980 } |
981 | 981 |
982 } // namespace blink | 982 } // namespace blink |
OLD | NEW |