Commit 224fe045 authored by Dominique Fauteux-Chapleau's avatar Dominique Fauteux-Chapleau Committed by Commit Bot

Ignore drag/drop input events in Mac

Makes drag/drop events obey the "ignore events" flag on WebContents.
Also add extra early returns in "update" and "exit" since those can
be called if the user drags/drops right after a scan completed.

This CL is the Mac version of the changes submitted in
crrev.com/c/2078654 for Aura.

Bug: 1045015
Change-Id: I4dfa3b2675b344ce7befa6be37f24d89957bf16e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078782Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Dominique Fauteux-Chapleau <domfc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745422}
parent 9b75bb0c
......@@ -178,6 +178,9 @@ void DropCompletionCallback(
}
- (NSDragOperation)draggingEntered:(const DraggingInfo*)info {
if (_webContents->ShouldIgnoreInputEvents())
return NSDragOperationNone;
// Save off the RVH so we can tell if it changes during a drag. If it does,
// we need to send a new enter message in draggingUpdated:.
_currentRVH = _webContents->GetRenderViewHost();
......@@ -239,6 +242,12 @@ void DropCompletionCallback(
}
- (void)draggingExited {
if (_webContents->ShouldIgnoreInputEvents())
return;
if (!_dropDataFiltered || !_dropDataUnfiltered)
return;
DCHECK(_currentRVH);
if (_currentRVH != _webContents->GetRenderViewHost())
return;
......@@ -261,6 +270,12 @@ void DropCompletionCallback(
}
- (NSDragOperation)draggingUpdated:(const DraggingInfo*)info {
if (_webContents->ShouldIgnoreInputEvents())
return NSDragOperationNone;
if (!_dropDataFiltered || !_dropDataUnfiltered)
return NSDragOperationNone;
if (_canceled) {
// TODO(ekaramad,paulmeyer): We probably shouldn't be checking for
// |canceled_| twice in this method.
......@@ -320,6 +335,9 @@ void DropCompletionCallback(
- (BOOL)performDragOperation:(const DraggingInfo*)info
withWebContentsViewDelegate:
(content::WebContentsViewDelegate*)webContentsViewDelegate {
if (_webContents->ShouldIgnoreInputEvents())
return NO;
gfx::PointF transformedPt;
content::RenderWidgetHostImpl* targetRWH =
[self GetRenderWidgetHostAtPoint:info->location_in_view
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment