Improve the handling of ContentWindow Events.
Fix build with Poppler system packages.

Change-Id: Ia354d1040b1be76f84429df20558f056404d7121