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 "components/html_viewer/ax_provider_impl.h" | 5 #include "components/html_viewer/ax_provider_impl.h" |
6 | 6 |
7 #include "components/html_viewer/blink_basic_type_converters.h" | 7 #include "components/html_viewer/blink_basic_type_converters.h" |
8 #include "third_party/WebKit/public/platform/WebURL.h" | 8 #include "third_party/WebKit/public/platform/WebURL.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/WebSettings.h" | 10 #include "third_party/WebKit/public/web/WebSettings.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 | 74 |
75 result = mojo::AxNode::New(); | 75 result = mojo::AxNode::New(); |
76 result->id = static_cast<int>(ax_object.axID()); | 76 result->id = static_cast<int>(ax_object.axID()); |
77 result->parent_id = parent_id; | 77 result->parent_id = parent_id; |
78 result->next_sibling_id = next_sibling_id; | 78 result->next_sibling_id = next_sibling_id; |
79 result->bounds = mojo::Rect::From(ax_object.boundingBoxRect()); | 79 result->bounds = mojo::Rect::From(ax_object.boundingBoxRect()); |
80 | 80 |
81 if (ax_object.isAnchor()) { | 81 if (ax_object.isAnchor()) { |
82 result->link = mojo::AxLink::New(); | 82 result->link = mojo::AxLink::New(); |
83 result->link->url = String::From(ax_object.url().string()); | 83 result->link->url = String::From(ax_object.url().string()); |
84 } else if (ax_object.childCount() == 0 && | 84 } else if (ax_object.childCount() == 0) { |
85 !ax_object.stringValue().isEmpty()) { | 85 blink::WebAXNameFrom nameFrom; |
86 result->text = mojo::AxText::New(); | 86 blink::WebVector<WebAXObject> nameObjects; |
87 result->text->content = String::From(ax_object.stringValue()); | 87 blink::WebString name = ax_object.name(nameFrom, nameObjects); |
aboxhall
2015/11/13 23:13:48
Would it make sense to create a version of name()
dmazzoni
2015/11/16 18:52:03
Done.
| |
88 if (!name.isEmpty()) { | |
89 result->text = mojo::AxText::New(); | |
90 result->text->content = String::From(name); | |
91 } | |
88 } | 92 } |
89 | 93 |
90 return result.Pass(); | 94 return result.Pass(); |
91 } | 95 } |
92 | 96 |
93 } // namespace html_viewer | 97 } // namespace html_viewer |
OLD | NEW |