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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 } | 927 } |
928 | 928 |
929 void DragController::doSystemDrag(DragImage* image, const IntPoint& dragLocation
, const IntPoint& eventPos, DataTransfer* dataTransfer, LocalFrame* frame, bool
forLink) | 929 void DragController::doSystemDrag(DragImage* image, const IntPoint& dragLocation
, const IntPoint& eventPos, DataTransfer* dataTransfer, LocalFrame* frame, bool
forLink) |
930 { | 930 { |
931 m_didInitiateDrag = true; | 931 m_didInitiateDrag = true; |
932 m_dragInitiator = frame->document(); | 932 m_dragInitiator = frame->document(); |
933 // Protect this frame and view, as a load may occur mid drag and attempt to
unload this frame | 933 // Protect this frame and view, as a load may occur mid drag and attempt to
unload this frame |
934 RefPtrWillBeRawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame(
); | 934 RefPtrWillBeRawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame(
); |
935 RefPtrWillBeRawPtr<FrameView> mainFrameView = mainFrame->view(); | 935 RefPtrWillBeRawPtr<FrameView> mainFrameView = mainFrame->view(); |
936 | 936 |
937 m_client->startDrag(image, mainFrameView->rootViewToContents(frame->view()->
contentsToRootView(dragLocation)), | 937 m_client->startDrag(image, mainFrameView->rootFrameToContents(frame->view()-
>contentsToRootFrame(dragLocation)), |
938 mainFrameView->rootViewToContents(frame->view()->contentsToRootView(even
tPos)), dataTransfer, frame, forLink); | 938 mainFrameView->rootFrameToContents(frame->view()->contentsToRootFrame(ev
entPos)), dataTransfer, frame, forLink); |
939 // DragClient::startDrag can cause our Page to dispear, deallocating |this|. | 939 // DragClient::startDrag can cause our Page to dispear, deallocating |this|. |
940 if (!frame->page()) | 940 if (!frame->page()) |
941 return; | 941 return; |
942 | 942 |
943 cleanupAfterSystemDrag(); | 943 cleanupAfterSystemDrag(); |
944 } | 944 } |
945 | 945 |
946 DragOperation DragController::dragOperation(DragData* dragData) | 946 DragOperation DragController::dragOperation(DragData* dragData) |
947 { | 947 { |
948 // FIXME: To match the MacOS behaviour we should return DragOperationNone | 948 // FIXME: To match the MacOS behaviour we should return DragOperationNone |
(...skipping 21 matching lines...) Expand all Loading... |
970 | 970 |
971 void DragController::trace(Visitor* visitor) | 971 void DragController::trace(Visitor* visitor) |
972 { | 972 { |
973 visitor->trace(m_page); | 973 visitor->trace(m_page); |
974 visitor->trace(m_documentUnderMouse); | 974 visitor->trace(m_documentUnderMouse); |
975 visitor->trace(m_dragInitiator); | 975 visitor->trace(m_dragInitiator); |
976 visitor->trace(m_fileInputElementUnderMouse); | 976 visitor->trace(m_fileInputElementUnderMouse); |
977 } | 977 } |
978 | 978 |
979 } // namespace blink | 979 } // namespace blink |
OLD | NEW |