| 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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 node->document().updateStyleAndLayoutTree(); | 854 node->document().updateStyleAndLayoutTree(); |
| 855 if (hasRichlyEditableStyle(*node)) { | 855 if (hasRichlyEditableStyle(*node)) { |
| 856 // TODO(editing-dev): We should use |EphemeralRange| instead of |Range|. | 856 // TODO(editing-dev): We should use |EphemeralRange| instead of |Range|. |
| 857 Range* range = source->document()->createRange(); | 857 Range* range = source->document()->createRange(); |
| 858 range->selectNode(node, ASSERT_NO_EXCEPTION); | 858 range->selectNode(node, ASSERT_NO_EXCEPTION); |
| 859 source->selection().setSelection( | 859 source->selection().setSelection( |
| 860 SelectionInDOMTree::Builder() | 860 SelectionInDOMTree::Builder() |
| 861 .setBaseAndExtent(EphemeralRange(range)) | 861 .setBaseAndExtent(EphemeralRange(range)) |
| 862 .build()); | 862 .build()); |
| 863 } | 863 } |
| 864 dataTransfer->declareAndWriteDragImage( | 864 dataTransfer->declareAndWriteDragImage(node, linkURL, imageURL, label); |
| 865 node, !linkURL.isEmpty() ? linkURL : imageURL, label); | |
| 866 } | 865 } |
| 867 | 866 |
| 868 bool DragController::populateDragDataTransfer(LocalFrame* src, | 867 bool DragController::populateDragDataTransfer(LocalFrame* src, |
| 869 const DragState& state, | 868 const DragState& state, |
| 870 const IntPoint& dragOrigin) { | 869 const IntPoint& dragOrigin) { |
| 871 #if DCHECK_IS_ON() | 870 #if DCHECK_IS_ON() |
| 872 DCHECK(dragTypeIsValid(state.m_dragType)); | 871 DCHECK(dragTypeIsValid(state.m_dragType)); |
| 873 #endif | 872 #endif |
| 874 DCHECK(src); | 873 DCHECK(src); |
| 875 if (!src->view() || src->contentLayoutItem().isNull()) | 874 if (!src->view() || src->contentLayoutItem().isNull()) |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 } | 1230 } |
| 1232 | 1231 |
| 1233 DEFINE_TRACE(DragController) { | 1232 DEFINE_TRACE(DragController) { |
| 1234 visitor->trace(m_page); | 1233 visitor->trace(m_page); |
| 1235 visitor->trace(m_documentUnderMouse); | 1234 visitor->trace(m_documentUnderMouse); |
| 1236 visitor->trace(m_dragInitiator); | 1235 visitor->trace(m_dragInitiator); |
| 1237 visitor->trace(m_fileInputElementUnderMouse); | 1236 visitor->trace(m_fileInputElementUnderMouse); |
| 1238 } | 1237 } |
| 1239 | 1238 |
| 1240 } // namespace blink | 1239 } // namespace blink |
| OLD | NEW |