| 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 "extensions/renderer/api/automation/automation_api_helper.h" | 5 #include "extensions/renderer/api/automation/automation_api_helper.h" |
| 6 | 6 |
| 7 #include "content/public/renderer/render_view.h" | 7 #include "content/public/renderer/render_view.h" |
| 8 #include "extensions/common/extension_messages.h" | 8 #include "extensions/common/extension_messages.h" |
| 9 #include "third_party/WebKit/public/web/WebAXObject.h" | 9 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 10 #include "third_party/WebKit/public/web/WebDocument.h" | 10 #include "third_party/WebKit/public/web/WebDocument.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 routing_id(), request_id, error, 0)); | 67 routing_id(), request_id, error, 0)); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| 71 start_node = start_acc_obj.node(); | 71 start_node = start_acc_obj.node(); |
| 72 while (start_node.isNull()) { | 72 while (start_node.isNull()) { |
| 73 start_acc_obj = start_acc_obj.parentObject(); | 73 start_acc_obj = start_acc_obj.parentObject(); |
| 74 start_node = start_acc_obj.node(); | 74 start_node = start_acc_obj.node(); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 blink::WebString web_selector(selector); | 77 blink::WebString web_selector = blink::WebString::fromUTF16(selector); |
| 78 blink::WebElement result_element = start_node.querySelector(web_selector); | 78 blink::WebElement result_element = start_node.querySelector(web_selector); |
| 79 int result_acc_obj_id = 0; | 79 int result_acc_obj_id = 0; |
| 80 if (!result_element.isNull()) { | 80 if (!result_element.isNull()) { |
| 81 blink::WebAXObject result_acc_obj = result_element.accessibilityObject(); | 81 blink::WebAXObject result_acc_obj = result_element.accessibilityObject(); |
| 82 if (!result_acc_obj.isDetached()) { | 82 if (!result_acc_obj.isDetached()) { |
| 83 while (result_acc_obj.accessibilityIsIgnored()) | 83 while (result_acc_obj.accessibilityIsIgnored()) |
| 84 result_acc_obj = result_acc_obj.parentObject(); | 84 result_acc_obj = result_acc_obj.parentObject(); |
| 85 | 85 |
| 86 result_acc_obj_id = result_acc_obj.axID(); | 86 result_acc_obj_id = result_acc_obj.axID(); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 Send(new ExtensionHostMsg_AutomationQuerySelector_Result( | 89 Send(new ExtensionHostMsg_AutomationQuerySelector_Result( |
| 90 routing_id(), request_id, error, result_acc_obj_id)); | 90 routing_id(), request_id, error, result_acc_obj_id)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace extensions | 93 } // namespace extensions |
| OLD | NEW |