From 1057da7cbd8fe6257c667f346001b7e59902ea12 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Thu, 30 Oct 2008 23:51:39 +0000 Subject: When acting as a drop target, the webview keeps a cache of the drop data so we don't have to send it over the IPC for each drag move. However, if a page load happens during the drop, the webview changes and we lose the cached data. To handle this, we keep track of which RVH we're dragging over and if it changes, we re-send the drop data. Review URL: http://codereview.chromium.org/8744 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4249 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/web_drop_target.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'chrome/browser/web_drop_target.h') diff --git a/chrome/browser/web_drop_target.h b/chrome/browser/web_drop_target.h index 45b4c4e..28f4073 100644 --- a/chrome/browser/web_drop_target.h +++ b/chrome/browser/web_drop_target.h @@ -9,6 +9,7 @@ #include "base/scoped_ptr.h" class InterstitialDropTarget; +class RenderViewHost; class WebContents; /////////////////////////////////////////////////////////////////////////////// @@ -52,14 +53,20 @@ class WebDropTarget : public BaseDropTarget { // Our associated WebContents. WebContents* web_contents_; - // A special drop target handler for when we try to d&d while an interstitial - // page is showing. - scoped_ptr interstitial_drop_target_; + // We keep track of the render view host we're dragging over. If it changes + // during a drag, we need to re-send the DragEnter message. WARNING: + // this pointer should never be dereferenced. We only use it for comparing + // pointers. + RenderViewHost* current_rvh_; // Used to determine what cursor we should display when dragging over web // content area. This can be updated async during a drag operation. bool is_drop_target_; + // A special drop target handler for when we try to d&d while an interstitial + // page is showing. + scoped_ptr interstitial_drop_target_; + DISALLOW_EVIL_CONSTRUCTORS(WebDropTarget); }; -- cgit v1.1