crostini: decouple lifetime of export import controller and notification
The lifetime of CrostiniExportImportNotificationController used to be 1to1 with the lifetime of the NotificationUI. This is unnecessary and makes it harder to reuse this functionality more broadly (see https://chromium-review.googlesource.com/c/chromium/src/+/1985621/3 for an example which has very complicated lifetime management due to this). This CL separates the Controller's lifetime from the UI's lifetime by extracting the Controller's UI event handling logic (clicking/closing) into a delegate which the controller creates, such that its lifetime is 1to1 with the UI, thus allowing the Controller to be destroyed at anytime without affecting the behaviour of the UI. Bug: 1024693 Change-Id: I6c67016f862e80dcd1c92a12d507f484c28fe4de tbr: stevenjb@chromium.org tbr: tengs@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1991060 Commit-Queue: Julian Watson <juwa@google.com> Reviewed-by:David Munro <davidmunro@google.com> Cr-Commit-Position: refs/heads/master@{#731788}
Showing
This diff is collapsed.
Please register or sign in to comment