summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webview_impl.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 23:25:03 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 23:25:03 +0000
commit0bcde72cee05bb587e7069a490081834e6ceac1c (patch)
tree7b5e59f055a1f038ceb7e891a054c26acc6d1d7e /webkit/glue/webview_impl.cc
parent4f8b87a4c6d06ebad053160a61fc90492afc8439 (diff)
downloadchromium_src-0bcde72cee05bb587e7069a490081834e6ceac1c.zip
chromium_src-0bcde72cee05bb587e7069a490081834e6ceac1c.tar.gz
chromium_src-0bcde72cee05bb587e7069a490081834e6ceac1c.tar.bz2
Remove windows-isms from drag & drop. This
makes it more portable, fixes some bugs, and removes glue from port. Review URL: http://codereview.chromium.org/9801 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webview_impl.cc')
-rw-r--r--webkit/glue/webview_impl.cc29
1 files changed, 12 insertions, 17 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index c807b31..bf46c9d 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -83,6 +83,7 @@ MSVC_POP_WARNING();
#include "base/message_loop.h"
#include "base/string_util.h"
#include "webkit/glue/chrome_client_impl.h"
+#include "webkit/glue/clipboard_conversion.h"
#include "webkit/glue/context_menu_client_impl.h"
#include "webkit/glue/dragclient_impl.h"
#include "webkit/glue/editor_client_impl.h"
@@ -1413,14 +1414,10 @@ bool WebViewImpl::DragTargetDragEnter(const WebDropData& drop_data,
int client_x, int client_y, int screen_x, int screen_y) {
DCHECK(!current_drop_data_.get());
- // Copy drop_data into current_drop_data_.
- WebDropData* drop_data_copy = new WebDropData;
- *drop_data_copy = drop_data;
- current_drop_data_.reset(drop_data_copy);
+ current_drop_data_ = webkit_glue::WebDropDataToChromiumDataObject(drop_data);
- DragData drag_data(reinterpret_cast<DragDataRef>(current_drop_data_.get()),
- IntPoint(client_x, client_y), IntPoint(screen_x, screen_y),
- kDropTargetOperation);
+ DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
+ IntPoint(screen_x, screen_y), kDropTargetOperation);
DragOperation effect = page_->dragController()->dragEntered(&drag_data);
return effect != DragOperationNone;
}
@@ -1428,29 +1425,27 @@ bool WebViewImpl::DragTargetDragEnter(const WebDropData& drop_data,
bool WebViewImpl::DragTargetDragOver(
int client_x, int client_y, int screen_x, int screen_y) {
DCHECK(current_drop_data_.get());
- DragData drag_data(reinterpret_cast<DragDataRef>(current_drop_data_.get()),
- IntPoint(client_x, client_y), IntPoint(screen_x, screen_y),
- kDropTargetOperation);
+ DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
+ IntPoint(screen_x, screen_y), kDropTargetOperation);
DragOperation effect = page_->dragController()->dragUpdated(&drag_data);
return effect != DragOperationNone;
}
void WebViewImpl::DragTargetDragLeave() {
DCHECK(current_drop_data_.get());
- DragData drag_data(reinterpret_cast<DragDataRef>(current_drop_data_.get()),
- IntPoint(), IntPoint(), DragOperationNone);
+ DragData drag_data(current_drop_data_.get(), IntPoint(), IntPoint(),
+ DragOperationNone);
page_->dragController()->dragExited(&drag_data);
- current_drop_data_.reset(NULL);
+ current_drop_data_ = NULL;
}
void WebViewImpl::DragTargetDrop(
int client_x, int client_y, int screen_x, int screen_y) {
DCHECK(current_drop_data_.get());
- DragData drag_data(reinterpret_cast<DragDataRef>(current_drop_data_.get()),
- IntPoint(client_x, client_y), IntPoint(screen_x, screen_y),
- kDropTargetOperation);
+ DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
+ IntPoint(screen_x, screen_y), kDropTargetOperation);
page_->dragController()->performDrag(&drag_data);
- current_drop_data_.reset(NULL);
+ current_drop_data_ = NULL;
}
SearchableFormData* WebViewImpl::CreateSearchableFormDataForFocusedNode() {