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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 m_documentUnderMouse = nullptr; | 258 m_documentUnderMouse = nullptr; |
259 return true; | 259 return true; |
260 } | 260 } |
261 | 261 |
262 m_documentUnderMouse = nullptr; | 262 m_documentUnderMouse = nullptr; |
263 | 263 |
264 if (operationForLoad(dragData) == DragOperationNone) | 264 if (operationForLoad(dragData) == DragOperationNone) |
265 return false; | 265 return false; |
266 | 266 |
267 if (m_page->settings().navigateOnDragDrop()) | 267 if (m_page->settings().navigateOnDragDrop()) |
268 m_page->mainFrame()->loader().load(FrameLoadRequest(0, ResourceRequest(d
ragData->asURL()))); | 268 m_page->mainFrame()->loader().load(FrameLoadRequest(0, ResourceRequest(d
ragData->asURL(DragData::ConvertFilenames)))); |
269 return true; | 269 return true; |
270 } | 270 } |
271 | 271 |
272 void DragController::mouseMovedIntoDocument(Document* newDocument) | 272 void DragController::mouseMovedIntoDocument(Document* newDocument) |
273 { | 273 { |
274 if (m_documentUnderMouse == newDocument) | 274 if (m_documentUnderMouse == newDocument) |
275 return; | 275 return; |
276 | 276 |
277 // If we were over another document clear the selection | 277 // If we were over another document clear the selection |
278 if (m_documentUnderMouse) | 278 if (m_documentUnderMouse) |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 cleanupAfterSystemDrag(); | 939 cleanupAfterSystemDrag(); |
940 } | 940 } |
941 | 941 |
942 DragOperation DragController::dragOperation(DragData* dragData) | 942 DragOperation DragController::dragOperation(DragData* dragData) |
943 { | 943 { |
944 // FIXME: To match the MacOS behaviour we should return DragOperationNone | 944 // FIXME: To match the MacOS behaviour we should return DragOperationNone |
945 // if we are a modal window, we are the drag source, or the window is an | 945 // if we are a modal window, we are the drag source, or the window is an |
946 // attached sheet If this can be determined from within WebCore | 946 // attached sheet If this can be determined from within WebCore |
947 // operationForDrag can be pulled into WebCore itself | 947 // operationForDrag can be pulled into WebCore itself |
948 ASSERT(dragData); | 948 ASSERT(dragData); |
949 return dragData->containsURL() && !m_didInitiateDrag ? DragOperationCopy : D
ragOperationNone; | 949 return dragData->containsURL(DragData::ConvertFilenames) && !m_didInitiateDr
ag ? DragOperationCopy : DragOperationNone; |
950 } | 950 } |
951 | 951 |
952 bool DragController::isCopyKeyDown(DragData* dragData) | 952 bool DragController::isCopyKeyDown(DragData* dragData) |
953 { | 953 { |
954 int keyState = dragData->modifierKeyState(); | 954 int keyState = dragData->modifierKeyState(); |
955 | 955 |
956 #if OS(MACOSX) | 956 #if OS(MACOSX) |
957 return keyState & PlatformEvent::AltKey; | 957 return keyState & PlatformEvent::AltKey; |
958 #else | 958 #else |
959 return keyState & PlatformEvent::CtrlKey; | 959 return keyState & PlatformEvent::CtrlKey; |
960 #endif | 960 #endif |
961 } | 961 } |
962 | 962 |
963 void DragController::cleanupAfterSystemDrag() | 963 void DragController::cleanupAfterSystemDrag() |
964 { | 964 { |
965 } | 965 } |
966 | 966 |
967 } // namespace WebCore | 967 } // namespace WebCore |
968 | 968 |
OLD | NEW |