| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/tools/test_shell/drop_delegate.h" | 5 #include "webkit/tools/test_shell/drop_delegate.h" |
| 6 | 6 |
| 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 10 #include "webkit/glue/webdropdata.h" | 10 #include "webkit/glue/webdropdata.h" |
| 11 | 11 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 22 DWORD TestDropDelegate::OnDragEnter(IDataObject* data_object, | 22 DWORD TestDropDelegate::OnDragEnter(IDataObject* data_object, |
| 23 DWORD key_state, | 23 DWORD key_state, |
| 24 POINT cursor_position, | 24 POINT cursor_position, |
| 25 DWORD effect) { | 25 DWORD effect) { |
| 26 WebDropData drop_data; | 26 WebDropData drop_data; |
| 27 WebDropData::PopulateWebDropData(data_object, &drop_data); | 27 WebDropData::PopulateWebDropData(data_object, &drop_data); |
| 28 | 28 |
| 29 POINT client_pt = cursor_position; | 29 POINT client_pt = cursor_position; |
| 30 ScreenToClient(GetHWND(), &client_pt); | 30 ScreenToClient(GetHWND(), &client_pt); |
| 31 WebDragOperation op = webview_->dragTargetDragEnter( | 31 WebDragOperation op = webview_->dragTargetDragEnter( |
| 32 drop_data.ToDragData(), 0, // web drag identity, unused. | 32 drop_data.ToDragData(), |
| 33 WebPoint(client_pt.x, client_pt.y), | 33 WebPoint(client_pt.x, client_pt.y), |
| 34 WebPoint(cursor_position.x, cursor_position.y), | 34 WebPoint(cursor_position.x, cursor_position.y), |
| 35 WebDragOperationCopy); | 35 WebDragOperationCopy); |
| 36 // TODO(snej): Pass the real drag operation instead | 36 // TODO(snej): Pass the real drag operation instead |
| 37 return op ? DROPEFFECT_COPY : DROPEFFECT_NONE; | 37 return op ? DROPEFFECT_COPY : DROPEFFECT_NONE; |
| 38 // TODO(snej): Return the real drop effect constant matching 'op' | 38 // TODO(snej): Return the real drop effect constant matching 'op' |
| 39 } | 39 } |
| 40 | 40 |
| 41 DWORD TestDropDelegate::OnDragOver(IDataObject* data_object, | 41 DWORD TestDropDelegate::OnDragOver(IDataObject* data_object, |
| 42 DWORD key_state, | 42 DWORD key_state, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 63 DWORD effect) { | 63 DWORD effect) { |
| 64 POINT client_pt = cursor_position; | 64 POINT client_pt = cursor_position; |
| 65 ScreenToClient(GetHWND(), &client_pt); | 65 ScreenToClient(GetHWND(), &client_pt); |
| 66 webview_->dragTargetDrop( | 66 webview_->dragTargetDrop( |
| 67 WebPoint(client_pt.x, client_pt.y), | 67 WebPoint(client_pt.x, client_pt.y), |
| 68 WebPoint(cursor_position.x, cursor_position.y)); | 68 WebPoint(cursor_position.x, cursor_position.y)); |
| 69 | 69 |
| 70 // webkit win port always returns DROPEFFECT_NONE | 70 // webkit win port always returns DROPEFFECT_NONE |
| 71 return DROPEFFECT_NONE; | 71 return DROPEFFECT_NONE; |
| 72 } | 72 } |
| OLD | NEW |