DescriptionReplace DidGetUserGesture with DidGetUserInteraction in the download request limiter.
User gestures such as clicks, gesture taps, and keyboard enter or space
are currently used as signals in the download request limiter that the
user is interacting with a page and therefore will accept a download
from the page. These gestures are currently signaled via
WebContentsObserver::DidGetUserGesture.
This CL replaces DidGetUserGesture with DidGetUserInteraction, which
triggers on all keyboard events and scrolls in addition to clicks and
taps. The latter method has a simpler implementation in content, signals
the type of interaction that triggered it, and is replacing the older
DidGetUserGesture method, of which the download request limiter is one
of only two clients. Scrolls are ignored, but other gestures are
accepted by the limiter (with tests updated to check this).
Functionally, the only change is that the limiter will now accept any
keyboard input as a gesture signal, rather than just enter or space.
This is appropriate as the gesture is being used as a heuristic for user
interaction with the page.
BUG=584154
Committed: https://crrev.com/71ad14d5cbffc802636071337a5db461357aae4c
Cr-Commit-Position: refs/heads/master@{#376865}
Patch Set 1 #Patch Set 2 : Fix tests on Android #Patch Set 3 : Fix comment #
Total comments: 2
Patch Set 4 : Addressing reviewer comment #
Messages
Total messages: 11 (4 generated)
|