-
mnaganov authored
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 Review URL: https://codereview.chromium.org/970883002 Cr-Commit-Position: refs/heads/master@{#319061}
b2803fd4