[go: nahoru, domu]

[iOS] Only present when the presentation context is active.

Previously, when the OverlayPresentationContext's coordinator is reset,
the presented UI was dismissed without notifying the presenter.  This
CL updates the implementation to have OverlayPresenter drive the
dismissal when the coordinator is reset.  This allows for the presenter
to be aware of all presentation/dismissal events so that its observers
can be notified when they occur (e.g. at the end of the tab grid =>
BVC transition animation).

To pipe this information back to OverlayPresenter, the presentation
context exposes IsActive(), which describes whether the context is
currently able to present.  When a coordinator is provided to the
context implementation, it notifies the presenter via observation that
it has become active, which triggers presentation.  When the coordinator
is reset to nil upon the BVC leaving the window, the presenter is
again notified via observation that the context is deactivating, which
triggers dismissal.

Bug: 941745
Change-Id: If06a9cd2aed18f34cf820423b42f24df78d22eea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1672173
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672685}
10 files changed