| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_ | 6 #define COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class WebTestDelegate; | 24 class WebTestDelegate; |
| 25 | 25 |
| 26 class AccessibilityController : | 26 class AccessibilityController : |
| 27 public base::SupportsWeakPtr<AccessibilityController> { | 27 public base::SupportsWeakPtr<AccessibilityController> { |
| 28 public: | 28 public: |
| 29 AccessibilityController(); | 29 AccessibilityController(); |
| 30 ~AccessibilityController(); | 30 ~AccessibilityController(); |
| 31 | 31 |
| 32 void Reset(); | 32 void Reset(); |
| 33 void Install(blink::WebFrame* frame); | 33 void Install(blink::WebFrame* frame); |
| 34 void SetFocusedElement(const blink::WebAXObject&); | |
| 35 bool ShouldLogAccessibilityEvents(); | 34 bool ShouldLogAccessibilityEvents(); |
| 36 void NotificationReceived(const blink::WebAXObject& target, | 35 void NotificationReceived(const blink::WebAXObject& target, |
| 37 const std::string& notification_name); | 36 const std::string& notification_name); |
| 38 | 37 |
| 39 void SetDelegate(WebTestDelegate* delegate); | 38 void SetDelegate(WebTestDelegate* delegate); |
| 40 void SetWebView(blink::WebView* web_view); | 39 void SetWebView(blink::WebView* web_view); |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 friend class AccessibilityControllerBindings; | 42 friend class AccessibilityControllerBindings; |
| 44 | 43 |
| 45 // Bound methods and properties | 44 // Bound methods and properties |
| 46 void LogAccessibilityEvents(); | 45 void LogAccessibilityEvents(); |
| 47 void SetNotificationListener(v8::Local<v8::Function> callback); | 46 void SetNotificationListener(v8::Local<v8::Function> callback); |
| 48 void UnsetNotificationListener(); | 47 void UnsetNotificationListener(); |
| 49 v8::Local<v8::Object> FocusedElement(); | 48 v8::Local<v8::Object> FocusedElement(); |
| 50 v8::Local<v8::Object> RootElement(); | 49 v8::Local<v8::Object> RootElement(); |
| 51 v8::Local<v8::Object> AccessibleElementById(const std::string& id); | 50 v8::Local<v8::Object> AccessibleElementById(const std::string& id); |
| 52 | 51 |
| 53 v8::Local<v8::Object> FindAccessibleElementByIdRecursive( | 52 v8::Local<v8::Object> FindAccessibleElementByIdRecursive( |
| 54 const blink::WebAXObject&, const blink::WebString& id); | 53 const blink::WebAXObject&, const blink::WebString& id); |
| 55 | 54 |
| 56 // If true, will log all accessibility notifications. | 55 // If true, will log all accessibility notifications. |
| 57 bool log_accessibility_events_; | 56 bool log_accessibility_events_; |
| 58 | 57 |
| 59 blink::WebAXObject focused_element_; | |
| 60 blink::WebAXObject root_element_; | |
| 61 | |
| 62 WebAXObjectProxyList elements_; | 58 WebAXObjectProxyList elements_; |
| 63 | 59 |
| 64 v8::Persistent<v8::Function> notification_callback_; | 60 v8::Persistent<v8::Function> notification_callback_; |
| 65 | 61 |
| 66 WebTestDelegate* delegate_; | 62 WebTestDelegate* delegate_; |
| 67 blink::WebView* web_view_; | 63 blink::WebView* web_view_; |
| 68 | 64 |
| 69 base::WeakPtrFactory<AccessibilityController> weak_factory_; | 65 base::WeakPtrFactory<AccessibilityController> weak_factory_; |
| 70 | 66 |
| 71 DISALLOW_COPY_AND_ASSIGN(AccessibilityController); | 67 DISALLOW_COPY_AND_ASSIGN(AccessibilityController); |
| 72 }; | 68 }; |
| 73 | 69 |
| 74 } // namespace test_runner | 70 } // namespace test_runner |
| 75 | 71 |
| 76 #endif // COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_ | 72 #endif // COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_ |
| OLD | NEW |