WebLayer doesn't use ApplicationStatus. In order for WebLayer to use
AccessibilityUtil this splits AccessibilityUtil into two parts. The
core part dealing with determining if accessibility is enabled remains
in AccessibilityUtil. The application state remains in a subclass called
ChromeAccessibilityUtil.
This code is easier to split when the there is an actual instance
created. So, rather than a bunch of static methods, you have to
create an instance of AccessibilityUtil. ChromeAccessibilityUtil takes
care of this. Doing this means all chrome code now has to call a static
function to get the instance. This necessitated a bunch of changes.
There is one other interesting change here. Previously
ApplicationStatus.ActivityStateListener, when RESUME was called, would
reset state so that the next call to isAccessibilityEnabled() would
trigger recalculating the value. If the value changed, this would *not*
notify observers. This seemed like a bug, so I made the RESUME case
immediately calculate the value and notify observers if necessary. Please
let me know if you think the old code was correct.
BUG=1085210
TEST=none
Change-Id: Id4e58da4f96fb9d218e59d3e62a94f0085827bb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210358
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773352}