[Switch Access] Remove event listener before adding to new menu reference
Avoid having multiple listeners set for the same action by removing the old one when setting a new one. Converts onButtonClicked_ to a static method because calling bind() creates a new object, making it impossible to remove without explicitly saving a reference to the bound function. AX-Relnotes: n/a. Bug: 982004 Change-Id: I76f788222b820bfb2698c63dda8b57d5104adae1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2290704Reviewed-by:Akihiro Ota <akihiroota@chromium.org> Commit-Queue: Anastasia Helfinstein <anastasi@google.com> Cr-Commit-Position: refs/heads/master@{#787874}
Showing
Please register or sign in to comment