OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITYCONTROLLER_H_ | |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITYCONTROLLER_H_ | |
7 | |
8 #include "content/shell/renderer/test_runner/CppBoundClass.h" | |
9 #include "content/shell/renderer/test_runner/WebAXObjectProxy.h" | |
10 | |
11 namespace blink { | |
12 class WebAXObject; | |
13 class WebFrame; | |
14 class WebView; | |
15 } | |
16 | |
17 namespace WebTestRunner { | |
18 | |
19 class WebTestDelegate; | |
20 | |
21 class AccessibilityController : public CppBoundClass { | |
22 public: | |
23 AccessibilityController(); | |
24 virtual ~AccessibilityController(); | |
25 | |
26 // Shadow to include accessibility initialization. | |
27 void bindToJavascript(blink::WebFrame*, const blink::WebString& classname); | |
28 void reset(); | |
29 | |
30 void setFocusedElement(const blink::WebAXObject&); | |
31 WebAXObjectProxy* getFocusedElement(); | |
32 WebAXObjectProxy* getRootElement(); | |
33 WebAXObjectProxy* getAccessibleElementById(const std::string& id); | |
34 | |
35 bool shouldLogAccessibilityEvents(); | |
36 | |
37 void notificationReceived(const blink::WebAXObject& target, const char* noti
ficationName); | |
38 | |
39 void setDelegate(WebTestDelegate* delegate) { m_delegate = delegate; } | |
40 void setWebView(blink::WebView* webView) { m_webView = webView; } | |
41 | |
42 private: | |
43 // If true, will log all accessibility notifications. | |
44 bool m_logAccessibilityEvents; | |
45 | |
46 // Bound methods and properties | |
47 void logAccessibilityEventsCallback(const CppArgumentList&, CppVariant*); | |
48 void fallbackCallback(const CppArgumentList&, CppVariant*); | |
49 void addNotificationListenerCallback(const CppArgumentList&, CppVariant*); | |
50 void removeNotificationListenerCallback(const CppArgumentList&, CppVariant*)
; | |
51 | |
52 void focusedElementGetterCallback(CppVariant*); | |
53 void rootElementGetterCallback(CppVariant*); | |
54 void accessibleElementByIdGetterCallback(const CppArgumentList&, CppVariant*
); | |
55 | |
56 WebAXObjectProxy* findAccessibleElementByIdRecursive(const blink::WebAXObjec
t&, const blink::WebString& id); | |
57 | |
58 blink::WebAXObject m_focusedElement; | |
59 blink::WebAXObject m_rootElement; | |
60 | |
61 WebAXObjectProxyList m_elements; | |
62 | |
63 std::vector<CppVariant> m_notificationCallbacks; | |
64 | |
65 WebTestDelegate* m_delegate; | |
66 blink::WebView* m_webView; | |
67 }; | |
68 | |
69 } | |
70 | |
71 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITYCONTROLLER_H_ | |
OLD | NEW |