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

Unified Diff: content/browser/web_contents/web_drag_dest_mac.mm

Issue 10783037: Don't send a DragLeave to the renderer if we didn't send a DragEnter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_drag_dest_mac.mm
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
index 7c97892dd4193da1e7f20eb77af542d1b3796f59..02bf7f2c951f2575f00bf50dee165365103927d7 100644
--- a/content/browser/web_contents/web_drag_dest_mac.mm
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
@@ -142,7 +142,8 @@ int GetModifierFlags() {
if (currentRVH_ != webContents_->GetRenderViewHost())
return;
- // Nothing to do in the interstitial case.
+ if ([self onlyAllowsNavigation])
+ return;
if (delegate_)
delegate_->OnDragLeave();
@@ -187,7 +188,6 @@ int GetModifierFlags() {
[self draggingEntered:info view:view];
// Check if we only allow navigation and navigate to a url on the pasteboard.
- BOOL result = YES;
if ([self onlyAllowsNavigation]) {
NSPasteboard* pboard = [info draggingPasteboard];
if ([pboard containsURLData]) {
@@ -196,14 +196,15 @@ int GetModifierFlags() {
webContents_->OpenURL(OpenURLParams(
url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_AUTO_BOOKMARK,
false));
+ return YES;
} else {
- result = NO;
+ return NO;
}
- } else {
- if (delegate_)
- delegate_->OnDrop();
}
+ if (delegate_)
+ delegate_->OnDrop();
+
currentRVH_ = NULL;
// Create the appropriate mouse locations for WebCore. The draggingLocation
@@ -218,7 +219,7 @@ int GetModifierFlags() {
dropData_.reset();
- return result;
+ return YES;
}
// Given |data|, which should not be nil, fill it in using the contents of the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698