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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 if (file_input->GetLayoutObject()) | 547 if (file_input->GetLayoutObject()) |
548 DCHECK_EQ(file_input, element); | 548 DCHECK_EQ(file_input, element); |
549 if (file_input->IsDisabledFormControl()) | 549 if (file_input->IsDisabledFormControl()) |
550 return false; | 550 return false; |
551 | 551 |
552 return file_input->ReceiveDroppedFiles(drag_data); | 552 return file_input->ReceiveDroppedFiles(drag_data); |
553 } | 553 } |
554 | 554 |
555 // TODO(paulmeyer): Isn't |m_page->dragController()| the same as |this|? | 555 // TODO(paulmeyer): Isn't |m_page->dragController()| the same as |this|? |
556 if (!page_->GetDragController().CanProcessDrag( | 556 if (!page_->GetDragController().CanProcessDrag( |
557 drag_data, *inner_frame->LocalFrameRoot())) { | 557 drag_data, inner_frame->LocalFrameRoot())) { |
558 page_->GetDragCaret().Clear(); | 558 page_->GetDragCaret().Clear(); |
559 return false; | 559 return false; |
560 } | 560 } |
561 | 561 |
562 if (page_->GetDragCaret().HasCaret()) { | 562 if (page_->GetDragCaret().HasCaret()) { |
563 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets | 563 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets |
564 // needs to be audited. See http://crbug.com/590369 for more details. | 564 // needs to be audited. See http://crbug.com/590369 for more details. |
565 page_->GetDragCaret() | 565 page_->GetDragCaret() |
566 .CaretPosition() | 566 .CaretPosition() |
567 .GetPosition() | 567 .GetPosition() |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 // TODO(esprehn): forLink is dead code, what was it for? | 1205 // TODO(esprehn): forLink is dead code, what was it for? |
1206 void DragController::DoSystemDrag(DragImage* image, | 1206 void DragController::DoSystemDrag(DragImage* image, |
1207 const IntPoint& drag_location, | 1207 const IntPoint& drag_location, |
1208 const IntPoint& event_pos, | 1208 const IntPoint& event_pos, |
1209 DataTransfer* data_transfer, | 1209 DataTransfer* data_transfer, |
1210 LocalFrame* frame, | 1210 LocalFrame* frame, |
1211 bool for_link) { | 1211 bool for_link) { |
1212 did_initiate_drag_ = true; | 1212 did_initiate_drag_ = true; |
1213 drag_initiator_ = frame->GetDocument(); | 1213 drag_initiator_ = frame->GetDocument(); |
1214 | 1214 |
1215 LocalFrame* main_frame = frame->LocalFrameRoot(); | 1215 FrameView* main_frame_view = frame->LocalFrameRoot().View(); |
1216 FrameView* main_frame_view = main_frame->View(); | |
1217 IntPoint adjusted_drag_location = main_frame_view->RootFrameToContents( | 1216 IntPoint adjusted_drag_location = main_frame_view->RootFrameToContents( |
1218 frame->View()->ContentsToRootFrame(drag_location)); | 1217 frame->View()->ContentsToRootFrame(drag_location)); |
1219 IntPoint adjusted_event_pos = main_frame_view->RootFrameToContents( | 1218 IntPoint adjusted_event_pos = main_frame_view->RootFrameToContents( |
1220 frame->View()->ContentsToRootFrame(event_pos)); | 1219 frame->View()->ContentsToRootFrame(event_pos)); |
1221 WebDragData drag_data = data_transfer->GetDataObject()->ToWebDragData(); | 1220 WebDragData drag_data = data_transfer->GetDataObject()->ToWebDragData(); |
1222 WebDragOperationsMask drag_operation_mask = | 1221 WebDragOperationsMask drag_operation_mask = |
1223 static_cast<WebDragOperationsMask>(data_transfer->SourceOperation()); | 1222 static_cast<WebDragOperationsMask>(data_transfer->SourceOperation()); |
1224 IntSize offset_size(adjusted_event_pos - adjusted_drag_location); | 1223 IntSize offset_size(adjusted_event_pos - adjusted_drag_location); |
1225 WebPoint offset_point(offset_size.Width(), offset_size.Height()); | 1224 WebPoint offset_point(offset_size.Width(), offset_size.Height()); |
1226 WebImage drag_image; | 1225 WebImage drag_image; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 | 1268 |
1270 DEFINE_TRACE(DragController) { | 1269 DEFINE_TRACE(DragController) { |
1271 visitor->Trace(page_); | 1270 visitor->Trace(page_); |
1272 visitor->Trace(document_under_mouse_); | 1271 visitor->Trace(document_under_mouse_); |
1273 visitor->Trace(drag_initiator_); | 1272 visitor->Trace(drag_initiator_); |
1274 visitor->Trace(drag_state_); | 1273 visitor->Trace(drag_state_); |
1275 visitor->Trace(file_input_element_under_mouse_); | 1274 visitor->Trace(file_input_element_under_mouse_); |
1276 } | 1275 } |
1277 | 1276 |
1278 } // namespace blink | 1277 } // namespace blink |
OLD | NEW |