- Add CefDragHandler to support examination of drag data and cancellation of drag requests (issue #297).

- Mac: Fix dragging of URLs by providing a default image if no drag image is supplied.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@279 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-08-22 01:31:55 +00:00
parent 88a46e0b44
commit 1b1255c92d
26 changed files with 1192 additions and 30 deletions

View File

@@ -11,9 +11,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
#include "ui/base/dragdrop/drop_target.h"
namespace WebKit {
class WebView;
};
class CefBrowserImpl;
class WebViewHost;
// A helper object that provides drop capabilities to a WebView. The
@@ -23,7 +21,7 @@ class WebDropTarget : public ui::DropTarget {
public:
// Create a new WebDropTarget associating it with the given HWND and
// WebView.
WebDropTarget(HWND source_hwnd, WebKit::WebView* view);
WebDropTarget(CefBrowserImpl* browser);
virtual ~WebDropTarget();
void set_drag_cursor(WebKit::WebDragOperation op) {
@@ -49,8 +47,8 @@ class WebDropTarget : public ui::DropTarget {
DWORD effect);
private:
// Our associated WebView.
WebKit::WebView* view_;
// Our associated CefBrowserImpl.
CefBrowserImpl* browser_;
// We keep track of the web view host we're dragging over. If it changes
// during a drag, we need to re-send the DragEnter message. WARNING:
@@ -62,6 +60,9 @@ class WebDropTarget : public ui::DropTarget {
// content area. This can be updated async during a drag operation.
WebKit::WebDragOperation drag_cursor_;
// True if the drag has been canceled.
bool canceled_;
DISALLOW_COPY_AND_ASSIGN(WebDropTarget);
};