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_WEBAXOBJECTPROXY_H_ | |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBAXOBJECTPROXY_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "content/shell/renderer/test_runner/CppBoundClass.h" | |
11 #include "third_party/WebKit/public/web/WebAXObject.h" | |
12 | |
13 namespace WebTestRunner { | |
14 | |
15 class WebAXObjectProxy : public CppBoundClass { | |
16 public: | |
17 class Factory { | |
18 public: | |
19 virtual ~Factory() { } | |
20 virtual WebAXObjectProxy* getOrCreate(const blink::WebAXObject&) = 0; | |
21 }; | |
22 | |
23 WebAXObjectProxy(const blink::WebAXObject&, Factory*); | |
24 virtual ~WebAXObjectProxy(); | |
25 | |
26 virtual WebAXObjectProxy* getChildAtIndex(unsigned); | |
27 virtual bool isRoot() const; | |
28 virtual bool isEqual(const blink::WebAXObject&); | |
29 | |
30 virtual void notificationReceived(const char *notificationName); | |
31 | |
32 protected: | |
33 const blink::WebAXObject& accessibilityObject() const { return m_accessibili
tyObject; } | |
34 | |
35 Factory* factory() const { return m_factory; } | |
36 | |
37 private: | |
38 // Bound properties. | |
39 void roleGetterCallback(CppVariant*); | |
40 void titleGetterCallback(CppVariant*); | |
41 void descriptionGetterCallback(CppVariant*); | |
42 void helpTextGetterCallback(CppVariant*); | |
43 void stringValueGetterCallback(CppVariant*); | |
44 void xGetterCallback(CppVariant*); | |
45 void yGetterCallback(CppVariant*); | |
46 void widthGetterCallback(CppVariant*); | |
47 void heightGetterCallback(CppVariant*); | |
48 void intValueGetterCallback(CppVariant*); | |
49 void minValueGetterCallback(CppVariant*); | |
50 void maxValueGetterCallback(CppVariant*); | |
51 void valueDescriptionGetterCallback(CppVariant*); | |
52 void childrenCountGetterCallback(CppVariant*); | |
53 void insertionPointLineNumberGetterCallback(CppVariant*); | |
54 void selectedTextRangeGetterCallback(CppVariant*); | |
55 void isEnabledGetterCallback(CppVariant*); | |
56 void isRequiredGetterCallback(CppVariant*); | |
57 void isFocusedGetterCallback(CppVariant*); | |
58 void isFocusableGetterCallback(CppVariant*); | |
59 void isSelectedGetterCallback(CppVariant*); | |
60 void isSelectableGetterCallback(CppVariant*); | |
61 void isMultiSelectableGetterCallback(CppVariant*); | |
62 void isSelectedOptionActiveGetterCallback(CppVariant*); | |
63 void isExpandedGetterCallback(CppVariant*); | |
64 void isCheckedGetterCallback(CppVariant*); | |
65 void isVisibleGetterCallback(CppVariant*); | |
66 void isOffScreenGetterCallback(CppVariant*); | |
67 void isCollapsedGetterCallback(CppVariant*); | |
68 void hasPopupGetterCallback(CppVariant*); | |
69 void isValidGetterCallback(CppVariant*); | |
70 void isReadOnlyGetterCallback(CppVariant*); | |
71 void orientationGetterCallback(CppVariant*); | |
72 void clickPointXGetterCallback(CppVariant*); | |
73 void clickPointYGetterCallback(CppVariant*); | |
74 void rowCountGetterCallback(CppVariant*); | |
75 void columnCountGetterCallback(CppVariant*); | |
76 void isClickableGetterCallback(CppVariant*); | |
77 | |
78 // Bound methods. | |
79 void allAttributesCallback(const CppArgumentList&, CppVariant*); | |
80 void attributesOfChildrenCallback(const CppArgumentList&, CppVariant*); | |
81 void lineForIndexCallback(const CppArgumentList&, CppVariant*); | |
82 void boundsForRangeCallback(const CppArgumentList&, CppVariant*); | |
83 void childAtIndexCallback(const CppArgumentList&, CppVariant*); | |
84 void elementAtPointCallback(const CppArgumentList&, CppVariant*); | |
85 void tableHeaderCallback(const CppArgumentList&, CppVariant*); | |
86 void rowIndexRangeCallback(const CppArgumentList&, CppVariant*); | |
87 void columnIndexRangeCallback(const CppArgumentList&, CppVariant*); | |
88 void cellForColumnAndRowCallback(const CppArgumentList&, CppVariant*); | |
89 void titleUIElementCallback(const CppArgumentList&, CppVariant*); | |
90 void setSelectedTextRangeCallback(const CppArgumentList&, CppVariant*); | |
91 void isAttributeSettableCallback(const CppArgumentList&, CppVariant*); | |
92 void isPressActionSupportedCallback(const CppArgumentList&, CppVariant*); | |
93 void isIncrementActionSupportedCallback(const CppArgumentList&, CppVariant*)
; | |
94 void isDecrementActionSupportedCallback(const CppArgumentList&, CppVariant*)
; | |
95 void parentElementCallback(const CppArgumentList&, CppVariant*); | |
96 void incrementCallback(const CppArgumentList&, CppVariant*); | |
97 void decrementCallback(const CppArgumentList&, CppVariant*); | |
98 void showMenuCallback(const CppArgumentList&, CppVariant*); | |
99 void pressCallback(const CppArgumentList&, CppVariant*); | |
100 void isEqualCallback(const CppArgumentList&, CppVariant*); | |
101 void addNotificationListenerCallback(const CppArgumentList&, CppVariant*); | |
102 void removeNotificationListenerCallback(const CppArgumentList&, CppVariant*)
; | |
103 void takeFocusCallback(const CppArgumentList&, CppVariant*); | |
104 void scrollToMakeVisibleCallback(const CppArgumentList&, CppVariant*); | |
105 void scrollToMakeVisibleWithSubFocusCallback(const CppArgumentList&, CppVari
ant*); | |
106 void scrollToGlobalPointCallback(const CppArgumentList&, CppVariant*); | |
107 void wordStartCallback(const CppArgumentList&, CppVariant*); | |
108 void wordEndCallback(const CppArgumentList&, CppVariant*); | |
109 | |
110 void fallbackCallback(const CppArgumentList&, CppVariant*); | |
111 | |
112 blink::WebAXObject m_accessibilityObject; | |
113 Factory* m_factory; | |
114 std::vector<CppVariant> m_notificationCallbacks; | |
115 }; | |
116 | |
117 | |
118 class RootWebAXObjectProxy : public WebAXObjectProxy { | |
119 public: | |
120 RootWebAXObjectProxy(const blink::WebAXObject&, Factory*); | |
121 | |
122 virtual WebAXObjectProxy* getChildAtIndex(unsigned) OVERRIDE; | |
123 virtual bool isRoot() const OVERRIDE; | |
124 }; | |
125 | |
126 | |
127 // Provides simple lifetime management of the WebAXObjectProxy instances: | |
128 // all WebAXObjectProxys ever created from the controller are stored in | |
129 // a list and cleared explicitly. | |
130 class WebAXObjectProxyList : public WebAXObjectProxy::Factory { | |
131 public: | |
132 WebAXObjectProxyList(); | |
133 virtual ~WebAXObjectProxyList(); | |
134 | |
135 void clear(); | |
136 virtual WebAXObjectProxy* getOrCreate(const blink::WebAXObject&) OVERRIDE; | |
137 WebAXObjectProxy* createRoot(const blink::WebAXObject&); | |
138 | |
139 private: | |
140 typedef std::vector<WebAXObjectProxy*> ElementList; | |
141 ElementList m_elements; | |
142 }; | |
143 | |
144 } | |
145 | |
146 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBAXOBJECTPROXY_H_ | |
OLD | NEW |