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