| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
| 10 #include "ClipboardChromium.h" | 10 #include "ClipboardChromium.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/logging.h" | 21 #include "base/logging.h" |
| 22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
| 23 #include "webkit/api/public/WebDragData.h" | 23 #include "webkit/api/public/WebDragData.h" |
| 24 #include "webkit/glue/context_menu.h" | 24 #include "webkit/glue/context_menu.h" |
| 25 #include "webkit/glue/glue_util.h" | 25 #include "webkit/glue/glue_util.h" |
| 26 #include "webkit/glue/webdropdata.h" | 26 #include "webkit/glue/webdropdata.h" |
| 27 #include "webkit/glue/webview_delegate.h" | 27 #include "webkit/glue/webview_delegate.h" |
| 28 #include "webkit/glue/webview_impl.h" | 28 #include "webkit/glue/webview_impl.h" |
| 29 | 29 |
| 30 using WebKit::WebDragData; | 30 using WebKit::WebDragData; |
| 31 using WebKit::WebPoint; |
| 31 | 32 |
| 32 void DragClientImpl::willPerformDragDestinationAction( | 33 void DragClientImpl::willPerformDragDestinationAction( |
| 33 WebCore::DragDestinationAction, | 34 WebCore::DragDestinationAction, |
| 34 WebCore::DragData*) { | 35 WebCore::DragData*) { |
| 35 // FIXME | 36 // FIXME |
| 36 } | 37 } |
| 37 | 38 |
| 38 void DragClientImpl::willPerformDragSourceAction( | 39 void DragClientImpl::willPerformDragSourceAction( |
| 39 WebCore::DragSourceAction, | 40 WebCore::DragSourceAction, |
| 40 const WebCore::IntPoint&, | 41 const WebCore::IntPoint&, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 64 const WebCore::IntPoint& event_pos, | 65 const WebCore::IntPoint& event_pos, |
| 65 WebCore::Clipboard* clipboard, | 66 WebCore::Clipboard* clipboard, |
| 66 WebCore::Frame* frame, | 67 WebCore::Frame* frame, |
| 67 bool is_link_drag) { | 68 bool is_link_drag) { |
| 68 // Add a ref to the frame just in case a load occurs mid-drag. | 69 // Add a ref to the frame just in case a load occurs mid-drag. |
| 69 RefPtr<WebCore::Frame> frame_protector = frame; | 70 RefPtr<WebCore::Frame> frame_protector = frame; |
| 70 | 71 |
| 71 WebDragData drag_data = webkit_glue::ChromiumDataObjectToWebDragData( | 72 WebDragData drag_data = webkit_glue::ChromiumDataObjectToWebDragData( |
| 72 static_cast<WebCore::ClipboardChromium*>(clipboard)->dataObject()); | 73 static_cast<WebCore::ClipboardChromium*>(clipboard)->dataObject()); |
| 73 | 74 |
| 74 webview_->StartDragging(drag_data); | 75 WebCore::DragOperation drag_operation_mask; |
| 76 if (!clipboard->sourceOperation(drag_operation_mask)) { |
| 77 drag_operation_mask = WebCore::DragOperationEvery; |
| 78 } |
| 79 |
| 80 webview_->StartDragging(webkit_glue::IntPointToWebPoint(event_pos), |
| 81 drag_data, |
| 82 static_cast<WebKit::WebDragOperationsMask>(drag_operation_mask)); |
| 75 } | 83 } |
| 76 | 84 |
| 77 WebCore::DragImageRef DragClientImpl::createDragImageForLink( | 85 WebCore::DragImageRef DragClientImpl::createDragImageForLink( |
| 78 WebCore::KURL&, | 86 WebCore::KURL&, |
| 79 const WebCore::String& label, | 87 const WebCore::String& label, |
| 80 WebCore::Frame*) { | 88 WebCore::Frame*) { |
| 81 // FIXME | 89 // FIXME |
| 82 return 0; | 90 return 0; |
| 83 } | 91 } |
| 84 | 92 |
| 85 void DragClientImpl::dragControllerDestroyed() { | 93 void DragClientImpl::dragControllerDestroyed() { |
| 86 delete this; | 94 delete this; |
| 87 } | 95 } |
| OLD | NEW |