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" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (root_element_.isNull()) | 236 if (root_element_.isNull()) |
237 root_element_ = web_view_->accessibilityObject(); | 237 root_element_ = web_view_->accessibilityObject(); |
238 return elements_.CreateRoot(root_element_); | 238 return elements_.CreateRoot(root_element_); |
239 } | 239 } |
240 | 240 |
241 v8::Handle<v8::Object> | 241 v8::Handle<v8::Object> |
242 AccessibilityController::AccessibleElementById(const std::string& id) { | 242 AccessibilityController::AccessibleElementById(const std::string& id) { |
243 if (root_element_.isNull()) | 243 if (root_element_.isNull()) |
244 root_element_ = web_view_->accessibilityObject(); | 244 root_element_ = web_view_->accessibilityObject(); |
245 | 245 |
246 if (!root_element_.updateBackingStoreAndCheckValidity()) | 246 if (!root_element_.updateLayoutAndCheckValidity()) |
247 return v8::Handle<v8::Object>(); | 247 return v8::Handle<v8::Object>(); |
248 | 248 |
249 return FindAccessibleElementByIdRecursive( | 249 return FindAccessibleElementByIdRecursive( |
250 root_element_, blink::WebString::fromUTF8(id.c_str())); | 250 root_element_, blink::WebString::fromUTF8(id.c_str())); |
251 } | 251 } |
252 | 252 |
253 v8::Handle<v8::Object> | 253 v8::Handle<v8::Object> |
254 AccessibilityController::FindAccessibleElementByIdRecursive( | 254 AccessibilityController::FindAccessibleElementByIdRecursive( |
255 const blink::WebAXObject& obj, const blink::WebString& id) { | 255 const blink::WebAXObject& obj, const blink::WebString& id) { |
256 if (obj.isNull() || obj.isDetached()) | 256 if (obj.isNull() || obj.isDetached()) |
(...skipping 12 matching lines...) Expand all Loading... |
269 v8::Handle<v8::Object> result = | 269 v8::Handle<v8::Object> result = |
270 FindAccessibleElementByIdRecursive(obj.childAt(i), id); | 270 FindAccessibleElementByIdRecursive(obj.childAt(i), id); |
271 if (*result) | 271 if (*result) |
272 return result; | 272 return result; |
273 } | 273 } |
274 | 274 |
275 return v8::Handle<v8::Object>(); | 275 return v8::Handle<v8::Object>(); |
276 } | 276 } |
277 | 277 |
278 } // namespace content | 278 } // namespace content |
OLD | NEW |