[Weblayer] Integrate with NetworkChangeNotifier.
This change adds an observer class to BrowserFragmentImpl, so we can observer when the first fragment using WebLayer is attached, and when the last such fragment is detached. For this duration, logic has been added to listen to changes using NetworkChangeNotifier. Manually tested using chrome://inspect and navigator.online(). Not able to test a javatest because the instrumentation test and the activity under test use different class loaders, causing two instances of the NetworkChangeNotifier singleton. It's thus hard to force/mock network connectivity state to observe changes to navigator.online() as a result. Bug: 1018848 Change-Id: I4a4c990ee6e98d5b35f91a68c15baa97def7cd6d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1971926 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by:Tobias Sargeant <tobiasjs@chromium.org> Cr-Commit-Position: refs/heads/master@{#726414}
Showing
Please register or sign in to comment