1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENT_RECORDER_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENT_RECORDER_H_
11 #include "base/macros.h"
12 #include "content/common/content_export.h"
16 class BrowserAccessibilityManager
;
18 // Listens for native accessibility events fired by a given
19 // BrowserAccessibilityManager and saves human-readable log strings for
20 // each event fired to a vector. Construct an instance of this class to
21 // begin listening, call GetEventLogs() to get all of the logs so far, and
22 // destroy it to stop listening.
24 // A log string should be of the form "<event> on <node>" where <event> is
25 // the name of the event fired (platform-specific) and <node> is information
26 // about the accessibility node on which the event was fired, for example its
29 // The implementation is highly platform-specific; a subclass is needed for
30 // each platform does most of the work.
31 class AccessibilityEventRecorder
{
33 // Construct the right platform-specific subclass.
34 static AccessibilityEventRecorder
* Create(
35 BrowserAccessibilityManager
* manager
);
36 virtual ~AccessibilityEventRecorder();
38 // Access the vector of human-readable event logs, one string per event.
39 const std::vector
<std::string
>& event_logs() { return event_logs_
; }
42 explicit AccessibilityEventRecorder(BrowserAccessibilityManager
* manager
);
44 BrowserAccessibilityManager
* manager_
;
45 std::vector
<std::string
> event_logs_
;
47 DISALLOW_COPY_AND_ASSIGN(AccessibilityEventRecorder
);
50 } // namespace content
52 #endif // CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENT_RECORDER_H_