[CrOS Cellular] Fix double-backward navigation when dongle unplugged.
When a cellular dongle is unplugged when the InternetDetailPage is visible, we "close" the dialog by navigating backward. However, this navigation is performed within a requestAnimationFrame() call, meaning that it is asynchronously performed sometime before the next repaint. It is possible that close() is called multiple times before the repaint actually occurs, resulting in multiple backward navigations. When settings is opened via chrome://settings in a browser tab (rather than from within a standalone settings window), this results in the browser navigating back to the page *before* the settings page was loaded, which is usually the NTP. This CL fixes this issue by simply returning early if close() has already been called. Bug: 956498 Change-Id: Iecbfb0f8a9e9db14e7d5ece40253686001ce8d18 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1622482 Auto-Submit: Kyle Horimoto <khorimoto@chromium.org> Reviewed-by:Steven Bennetts <stevenjb@chromium.org> Commit-Queue: Kyle Horimoto <khorimoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#662255}
Showing
Please register or sign in to comment