Merge "Extract event sending code into EventDispatcher."