Make KitkatCaptioningBridge a singleton
Currently each ContentViewCore creates a KitkatCaptioningBridge on K+ devices. And all of them listens to the system CaptioningManager. So whenever the system captioning changes, all ContentViewCores will have to handle it separately. This change simplifies that process by making KitkatCaptioningBridge a singleton. All ContentViewCores become listeners to that singleton. Whenever system captioning changes, a single CaptioningChangeDelegate class will handle the change. It will then inform all ContentViewCores that are alive. If all ContentViewCores are GC'ed, KitkatCaptioningBridge will stop listen to system CaptioningManager. BUG=457850 Review URL: https://codereview.chromium.org/1132053005 Cr-Commit-Position: refs/heads/master@{#330408}
Showing
Please register or sign in to comment