| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef AccessibilityController_h | 31 #ifndef AccessibilityController_h |
| 32 #define AccessibilityController_h | 32 #define AccessibilityController_h |
| 33 | 33 |
| 34 #include "CppBoundClass.h" | 34 #include "CppBoundClass.h" |
| 35 #include "WebAXObjectProxy.h" | 35 #include "WebAXObjectProxy.h" |
| 36 | 36 |
| 37 namespace WebKit { | 37 namespace blink { |
| 38 class WebAXObject; | 38 class WebAXObject; |
| 39 class WebFrame; | 39 class WebFrame; |
| 40 class WebView; | 40 class WebView; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace WebTestRunner { | 43 namespace WebTestRunner { |
| 44 | 44 |
| 45 class WebTestDelegate; | 45 class WebTestDelegate; |
| 46 | 46 |
| 47 class AccessibilityController : public CppBoundClass { | 47 class AccessibilityController : public CppBoundClass { |
| 48 public: | 48 public: |
| 49 AccessibilityController(); | 49 AccessibilityController(); |
| 50 | 50 |
| 51 // Shadow to include accessibility initialization. | 51 // Shadow to include accessibility initialization. |
| 52 void bindToJavascript(WebKit::WebFrame*, const WebKit::WebString& classname)
; | 52 void bindToJavascript(blink::WebFrame*, const blink::WebString& classname); |
| 53 void reset(); | 53 void reset(); |
| 54 | 54 |
| 55 void setFocusedElement(const WebKit::WebAXObject&); | 55 void setFocusedElement(const blink::WebAXObject&); |
| 56 WebAXObjectProxy* getFocusedElement(); | 56 WebAXObjectProxy* getFocusedElement(); |
| 57 WebAXObjectProxy* getRootElement(); | 57 WebAXObjectProxy* getRootElement(); |
| 58 WebAXObjectProxy* getAccessibleElementById(const std::string& id); | 58 WebAXObjectProxy* getAccessibleElementById(const std::string& id); |
| 59 | 59 |
| 60 bool shouldLogAccessibilityEvents(); | 60 bool shouldLogAccessibilityEvents(); |
| 61 | 61 |
| 62 void notificationReceived(const WebKit::WebAXObject& target, const char* not
ificationName); | 62 void notificationReceived(const blink::WebAXObject& target, const char* noti
ficationName); |
| 63 | 63 |
| 64 void setDelegate(WebTestDelegate* delegate) { m_delegate = delegate; } | 64 void setDelegate(WebTestDelegate* delegate) { m_delegate = delegate; } |
| 65 void setWebView(WebKit::WebView* webView) { m_webView = webView; } | 65 void setWebView(blink::WebView* webView) { m_webView = webView; } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 // If true, will log all accessibility notifications. | 68 // If true, will log all accessibility notifications. |
| 69 bool m_logAccessibilityEvents; | 69 bool m_logAccessibilityEvents; |
| 70 | 70 |
| 71 // Bound methods and properties | 71 // Bound methods and properties |
| 72 void logAccessibilityEventsCallback(const CppArgumentList&, CppVariant*); | 72 void logAccessibilityEventsCallback(const CppArgumentList&, CppVariant*); |
| 73 void fallbackCallback(const CppArgumentList&, CppVariant*); | 73 void fallbackCallback(const CppArgumentList&, CppVariant*); |
| 74 void addNotificationListenerCallback(const CppArgumentList&, CppVariant*); | 74 void addNotificationListenerCallback(const CppArgumentList&, CppVariant*); |
| 75 void removeNotificationListenerCallback(const CppArgumentList&, CppVariant*)
; | 75 void removeNotificationListenerCallback(const CppArgumentList&, CppVariant*)
; |
| 76 | 76 |
| 77 void focusedElementGetterCallback(CppVariant*); | 77 void focusedElementGetterCallback(CppVariant*); |
| 78 void rootElementGetterCallback(CppVariant*); | 78 void rootElementGetterCallback(CppVariant*); |
| 79 void accessibleElementByIdGetterCallback(const CppArgumentList&, CppVariant*
); | 79 void accessibleElementByIdGetterCallback(const CppArgumentList&, CppVariant*
); |
| 80 | 80 |
| 81 WebAXObjectProxy* findAccessibleElementByIdRecursive(const WebKit::WebAXObje
ct&, const WebKit::WebString& id); | 81 WebAXObjectProxy* findAccessibleElementByIdRecursive(const blink::WebAXObjec
t&, const blink::WebString& id); |
| 82 | 82 |
| 83 WebKit::WebAXObject m_focusedElement; | 83 blink::WebAXObject m_focusedElement; |
| 84 WebKit::WebAXObject m_rootElement; | 84 blink::WebAXObject m_rootElement; |
| 85 | 85 |
| 86 WebAXObjectProxyList m_elements; | 86 WebAXObjectProxyList m_elements; |
| 87 | 87 |
| 88 std::vector<CppVariant> m_notificationCallbacks; | 88 std::vector<CppVariant> m_notificationCallbacks; |
| 89 | 89 |
| 90 WebTestDelegate* m_delegate; | 90 WebTestDelegate* m_delegate; |
| 91 WebKit::WebView* m_webView; | 91 blink::WebView* m_webView; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } | 94 } |
| 95 | 95 |
| 96 #endif // AccessibilityController_h | 96 #endif // AccessibilityController_h |
| OLD | NEW |