Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: components/html_viewer/ax_provider_impl.cc

Issue 1435113003: Make use of new AX name calc in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue with ariaTextAlternative Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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::WebString name = ax_object.name();
86 result->text = mojo::AxText::New(); 86 if (!name.isEmpty()) {
87 result->text->content = String::From(ax_object.stringValue()); 87 result->text = mojo::AxText::New();
88 result->text->content = String::From(name);
89 }
88 } 90 }
89 91
90 return result.Pass(); 92 return result.Pass();
91 } 93 }
92 94
93 } // namespace html_viewer 95 } // namespace html_viewer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698