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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 std::unique_ptr<DragImage> drag_image = | 1117 std::unique_ptr<DragImage> drag_image = |
1118 data_transfer->CreateDragImage(drag_offset, src); | 1118 data_transfer->CreateDragImage(drag_offset, src); |
1119 if (drag_image) { | 1119 if (drag_image) { |
1120 drag_location = DragLocationForDHTMLDrag(mouse_dragged_point, drag_origin, | 1120 drag_location = DragLocationForDHTMLDrag(mouse_dragged_point, drag_origin, |
1121 drag_offset, !link_url.IsEmpty()); | 1121 drag_offset, !link_url.IsEmpty()); |
1122 } | 1122 } |
1123 | 1123 |
1124 Node* node = state.drag_src_.Get(); | 1124 Node* node = state.drag_src_.Get(); |
1125 if (state.drag_type_ == kDragSourceActionSelection) { | 1125 if (state.drag_type_ == kDragSourceActionSelection) { |
1126 if (!drag_image) { | 1126 if (!drag_image) { |
1127 drag_image = src->DragImageForSelection(kDragImageAlpha); | 1127 drag_image = DragImageForSelection(*src, kDragImageAlpha); |
1128 drag_location = DragLocationForSelectionDrag(src); | 1128 drag_location = DragLocationForSelectionDrag(src); |
1129 } | 1129 } |
1130 DoSystemDrag(drag_image.get(), drag_location, drag_origin, data_transfer, | 1130 DoSystemDrag(drag_image.get(), drag_location, drag_origin, data_transfer, |
1131 src, false); | 1131 src, false); |
1132 } else if (state.drag_type_ == kDragSourceActionImage) { | 1132 } else if (state.drag_type_ == kDragSourceActionImage) { |
1133 if (image_url.IsEmpty() || !node || !node->IsElementNode()) | 1133 if (image_url.IsEmpty() || !node || !node->IsElementNode()) |
1134 return false; | 1134 return false; |
1135 Element* element = ToElement(node); | 1135 Element* element = ToElement(node); |
1136 Image* image = GetImage(element); | 1136 Image* image = GetImage(element); |
1137 if (!image || image->IsNull() || !image->Data() || !image->Data()->size()) | 1137 if (!image || image->IsNull() || !image->Data() || !image->Data()->size()) |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 | 1269 |
1270 DEFINE_TRACE(DragController) { | 1270 DEFINE_TRACE(DragController) { |
1271 visitor->Trace(page_); | 1271 visitor->Trace(page_); |
1272 visitor->Trace(document_under_mouse_); | 1272 visitor->Trace(document_under_mouse_); |
1273 visitor->Trace(drag_initiator_); | 1273 visitor->Trace(drag_initiator_); |
1274 visitor->Trace(drag_state_); | 1274 visitor->Trace(drag_state_); |
1275 visitor->Trace(file_input_element_under_mouse_); | 1275 visitor->Trace(file_input_element_under_mouse_); |
1276 } | 1276 } |
1277 | 1277 |
1278 } // namespace blink | 1278 } // namespace blink |
OLD | NEW |