[chrome:accessibility] Display a list of accessibility events fired on a page.

Use the accessibility event recorder to capture events fired on a page, and
display the log on chrome:accessibility. This log isn't particularly
meaningful for now, but follow-up CLs will make this be more useful.

Bug: 785493
Change-Id: I5bf88bc070ac7df322cb41847a86642cbf038483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823617
Commit-Queue: Abigail Klein <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Dominic Mazzoni <[email protected]>
Cr-Commit-Position: refs/heads/master@{#711608}
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 075dd254..3b6ac0f 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -411,6 +411,18 @@
       std::vector<content::AccessibilityTreeFormatter::PropertyFilter>
           property_filters) = 0;
 
+  // A callback that takes a string which contains accessibility event
+  // information.
+  using AccessibilityEventCallback =
+      base::RepeatingCallback<void(const std::string&)>;
+
+  // Starts or stops recording accessibility events. While accessibility events
+  // are being recorded, the callback will be called when an accessibility
+  // event is received. The start paramater says whether the recording is
+  // starting or stopping.
+  virtual void RecordAccessibilityEvents(AccessibilityEventCallback callback,
+                                         bool start) = 0;
+
   virtual const PageImportanceSignals& GetPageImportanceSignals() = 0;
 
   // Tab navigation state ------------------------------------------------------