| 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 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 5 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 6 | 6 |
| 7 #include "gin/handle.h" | 7 #include "gin/handle.h" |
| 8 #include "gin/object_template_builder.h" | 8 #include "gin/object_template_builder.h" |
| 9 #include "gin/wrappable.h" | 9 #include "gin/wrappable.h" |
| 10 #include "third_party/WebKit/public/web/WebElement.h" | 10 #include "third_party/WebKit/public/web/WebElement.h" |
| 11 #include "third_party/WebKit/public/web/WebFrame.h" | 11 #include "third_party/WebKit/public/web/WebFrame.h" |
| 12 #include "third_party/WebKit/public/web/WebKit.h" | 12 #include "third_party/WebKit/public/web/WebKit.h" |
| 13 #include "third_party/WebKit/public/web/WebSettings.h" |
| 13 #include "third_party/WebKit/public/web/WebView.h" | 14 #include "third_party/WebKit/public/web/WebView.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 class AccessibilityControllerBindings | 18 class AccessibilityControllerBindings |
| 18 : public gin::Wrappable<AccessibilityControllerBindings> { | 19 : public gin::Wrappable<AccessibilityControllerBindings> { |
| 19 public: | 20 public: |
| 20 static gin::WrapperInfo kWrapperInfo; | 21 static gin::WrapperInfo kWrapperInfo; |
| 21 | 22 |
| 22 static void Install(base::WeakPtr<AccessibilityController> controller, | 23 static void Install(base::WeakPtr<AccessibilityController> controller, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void AccessibilityController::Reset() { | 141 void AccessibilityController::Reset() { |
| 141 root_element_ = blink::WebAXObject(); | 142 root_element_ = blink::WebAXObject(); |
| 142 focused_element_ = blink::WebAXObject(); | 143 focused_element_ = blink::WebAXObject(); |
| 143 elements_.Clear(); | 144 elements_.Clear(); |
| 144 notification_callback_.Reset(); | 145 notification_callback_.Reset(); |
| 145 log_accessibility_events_ = false; | 146 log_accessibility_events_ = false; |
| 146 } | 147 } |
| 147 | 148 |
| 148 void AccessibilityController::Install(blink::WebFrame* frame) { | 149 void AccessibilityController::Install(blink::WebFrame* frame) { |
| 149 blink::WebAXObject::enableAccessibility(); | 150 blink::WebAXObject::enableAccessibility(); |
| 151 frame->view()->settings()->setAccessibilityEnabled(true); |
| 152 |
| 150 blink::WebAXObject::enableInlineTextBoxAccessibility(); | 153 blink::WebAXObject::enableInlineTextBoxAccessibility(); |
| 154 frame->view()->settings()->setInlineTextBoxAccessibilityEnabled(true); |
| 155 |
| 151 AccessibilityControllerBindings::Install(weak_factory_.GetWeakPtr(), frame); | 156 AccessibilityControllerBindings::Install(weak_factory_.GetWeakPtr(), frame); |
| 152 } | 157 } |
| 153 | 158 |
| 154 void AccessibilityController::SetFocusedElement( | 159 void AccessibilityController::SetFocusedElement( |
| 155 const blink::WebAXObject& focused_element) { | 160 const blink::WebAXObject& focused_element) { |
| 156 focused_element_ = focused_element; | 161 focused_element_ = focused_element; |
| 157 } | 162 } |
| 158 | 163 |
| 159 bool AccessibilityController::ShouldLogAccessibilityEvents() { | 164 bool AccessibilityController::ShouldLogAccessibilityEvents() { |
| 160 return log_accessibility_events_; | 165 return log_accessibility_events_; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 v8::Handle<v8::Object> result = | 272 v8::Handle<v8::Object> result = |
| 268 FindAccessibleElementByIdRecursive(obj.childAt(i), id); | 273 FindAccessibleElementByIdRecursive(obj.childAt(i), id); |
| 269 if (*result) | 274 if (*result) |
| 270 return result; | 275 return result; |
| 271 } | 276 } |
| 272 | 277 |
| 273 return v8::Handle<v8::Object>(); | 278 return v8::Handle<v8::Object>(); |
| 274 } | 279 } |
| 275 | 280 |
| 276 } // namespace content | 281 } // namespace content |
| OLD | NEW |