Description[Android WebView] Synthesize a fake page loading event on page source modification (Re-land)
When a script modifies page source of a non-committed page, we need to
notify clients, so they can update the URL bar to avoid confusion.
New logic since the last attempt (https://codereview.chromium.org/924833003/):
distinguish between a "vanilla" WebView state (basically, a newly created
WebView, where no loading attempts have been made) and an "attempted to
navigate" state. In the "vanilla" state, don't fire synthesized page loading
events to avoid confusing clients. This is safe, as WebView is guaranteed to be
on a blank page.
Implementation note: we detect navigation attempts using
didStartProvisionalLoadForFrame WebContentsObserver event on the Java side. As
for popups AwWebContentsObserver gets re-attached from the original popup
WebView to the one provided by the client, notifications issued inbetween can be
missed on the Java side. To work around this, we assume that WebViews opened as
popups can never be in "vanilla" state (as they are anyway opened as a result of
navigation).
BUG=458569, 462213
TBR=davidben@chromium.org,tedchoc@chromium.org
Committed: https://crrev.com/b2803fd408c3709889645061fad42d3371024b93
Cr-Commit-Position: refs/heads/master@{#319061}
Patch Set 1 #
Total comments: 6
Patch Set 2 : Comments addressed #Patch Set 3 : Fixed findbugs warning #Messages
Total messages: 21 (7 generated)
|