Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: webkit/glue/webview_impl.cc

Issue 28108: Add an identity (id) to system drag & drop. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webview_impl.cc
===================================================================
--- webkit/glue/webview_impl.cc (revision 10310)
+++ webkit/glue/webview_impl.cc (working copy)
@@ -334,6 +334,8 @@
suppress_next_keypress_event_(false),
window_open_disposition_(IGNORE_ACTION),
ime_accept_events_(true),
+ drag_target_dispatch_(false),
+ drag_identity_(0),
autocomplete_popup_showing_(false) {
// WebKit/win/WebView.cpp does the same thing, except they call the
// KJS specific wrapper around this method. We need to have threading
@@ -1472,39 +1474,63 @@
DCHECK(!current_drop_data_.get());
current_drop_data_ = webkit_glue::WebDropDataToChromiumDataObject(drop_data);
+ drag_identity_ = drop_data.identity;
DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
IntPoint(screen_x, screen_y), kDropTargetOperation);
+ drag_target_dispatch_ = true;
DragOperation effect = page_->dragController()->dragEntered(&drag_data);
+ drag_target_dispatch_ = false;
+
return effect != DragOperationNone;
}
bool WebViewImpl::DragTargetDragOver(
int client_x, int client_y, int screen_x, int screen_y) {
DCHECK(current_drop_data_.get());
+
DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
IntPoint(screen_x, screen_y), kDropTargetOperation);
+ drag_target_dispatch_ = true;
DragOperation effect = page_->dragController()->dragUpdated(&drag_data);
+ drag_target_dispatch_ = false;
+
return effect != DragOperationNone;
}
void WebViewImpl::DragTargetDragLeave() {
DCHECK(current_drop_data_.get());
+
DragData drag_data(current_drop_data_.get(), IntPoint(), IntPoint(),
DragOperationNone);
+ drag_target_dispatch_ = true;
page_->dragController()->dragExited(&drag_data);
+ drag_target_dispatch_ = false;
+
current_drop_data_ = NULL;
+ drag_identity_ = 0;
}
void WebViewImpl::DragTargetDrop(
int client_x, int client_y, int screen_x, int screen_y) {
DCHECK(current_drop_data_.get());
+
DragData drag_data(current_drop_data_.get(), IntPoint(client_x, client_y),
IntPoint(screen_x, screen_y), kDropTargetOperation);
+ drag_target_dispatch_ = true;
page_->dragController()->performDrag(&drag_data);
+ drag_target_dispatch_ = false;
+
current_drop_data_ = NULL;
+ drag_identity_ = 0;
}
+int32 WebViewImpl::GetDragIdentity() {
+ if (drag_target_dispatch_)
+ return drag_identity_;
+ return 0;
+}
+
SearchableFormData* WebViewImpl::CreateSearchableFormDataForFocusedNode() {
if (!page_.get())
return NULL;
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698