[Ash] Inject VideoConferenceManagerAsh to its clients as a dependency
This CL needs to go after a previous CL crrev.com/c/6218261.
This CL formally dismantles the singleton design of
VideoConferenceManagerAsh. In other words, all four current clients of
VideoConferenceManagerAsh can no longer easily access the single and
globally shared VideoConferenceManagerAsh object through a static get
method.
The four currently known clients are:
1. video_conference::VideoConferenceManagerClientImpl
2. VideoConferenceAppServiceClient
3. VideoConferenceAshFeatureClient
4. ChromeCaptureModeDelegate
For 1, 2, and 3, the dependency will be injected through each client
class's constructor. For 4, the dependency will be injected through a
newly added setter method.
This Cl also updates affected browser tests of each client to reflect
this dependency injection change.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
ChromeCaptureModeDelegate::Get()->set_video_conference_manager_ash(@hide...@chromium.org Please note that I didn't use `ChromeShellDelegate` as a stepping stone to pass over the dependency from `ChromeBrowserMainPartsAsh` to `ChromeBrowserMainExtraPartsAsh` and finally to `ChromeCaptureModeDelegate`. And as you can see I definitely didn't pass it over through ctor injection, instead I created a dedicated setter to inject.
The reason is that the timing of the ctor for `ChromeShellDelegate` is earlier than the `PreProfileInit()` of both the `main parts` and the `main extra parts`. In addition, I cannot initialize `VideoConferenceManagerAsh` earlier than `PreProfileInit()` as `VideoConferenceManagerAsh` has its own dependency timing issues. What makes matters worse is, as `ChromeShellDelegate` itself has no static singleton access method, injecting a depedency to it at a later stage is not practical either.
So, as you see here, I opted for a tradeoff that piggybacks on the two static getter methods of `ChromeCaptureModeDelegate::Get()` and `ChromeBrowserMainExtraPartsAsh::Get()` to achieve the goal of injecting `VideoConferenceManagerAsh` at the right time.
I understand this whole chain of injection is convulted. I'm more than happy to keep revising this CL. Please let me know what you think.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |