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

Side by Side Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 559343002: Add AX attribute conversion for input type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add AX attribute conversion for input type Created 6 years, 2 months 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 "content/renderer/accessibility/blink_ax_tree_source.h" 5 #include "content/renderer/accessibility/blink_ax_tree_source.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 WebVector<int> src_line_breaks; 338 WebVector<int> src_line_breaks;
339 src.lineBreaks(src_line_breaks); 339 src.lineBreaks(src_line_breaks);
340 if (src_line_breaks.size() > 0) { 340 if (src_line_breaks.size() > 0) {
341 std::vector<int32> line_breaks; 341 std::vector<int32> line_breaks;
342 line_breaks.reserve(src_line_breaks.size()); 342 line_breaks.reserve(src_line_breaks.size());
343 for (size_t i = 0; i < src_line_breaks.size(); ++i) 343 for (size_t i = 0; i < src_line_breaks.size(); ++i)
344 line_breaks.push_back(src_line_breaks[i]); 344 line_breaks.push_back(src_line_breaks[i]);
345 dst->AddIntListAttribute(ui::AX_ATTR_LINE_BREAKS, line_breaks); 345 dst->AddIntListAttribute(ui::AX_ATTR_LINE_BREAKS, line_breaks);
346 } 346 }
347
348 if (dst->role == ui::AX_ROLE_TEXT_FIELD &&
349 src.textInputType().length()) {
350 dst->AddStringAttribute(ui::AX_ATTR_TEXT_INPUT_TYPE,
351 UTF16ToUTF8(src.textInputType()));
dmazzoni 2014/09/26 15:29:16 nit: either line up with ui::AX_ATTR_... from prev
je_julie(Not used) 2014/09/28 14:57:26 OK. I'll line up. On 2014/09/26 15:29:16, dmazzoni
352 }
347 } 353 }
348 354
349 // ARIA role. 355 // ARIA role.
350 if (element.hasAttribute("role")) { 356 if (element.hasAttribute("role")) {
351 dst->AddStringAttribute(ui::AX_ATTR_ROLE, 357 dst->AddStringAttribute(ui::AX_ATTR_ROLE,
352 UTF16ToUTF8(element.getAttribute("role"))); 358 UTF16ToUTF8(element.getAttribute("role")));
353 } else { 359 } else {
354 std::string role = GetEquivalentAriaRoleString(dst->role); 360 std::string role = GetEquivalentAriaRoleString(dst->role);
355 if (!role.empty()) 361 if (!role.empty())
356 dst->AddStringAttribute(ui::AX_ATTR_ROLE, role); 362 dst->AddStringAttribute(ui::AX_ATTR_ROLE, role);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); 602 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst);
597 } 603 }
598 604
599 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { 605 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const {
600 if (render_frame_ && render_frame_->GetWebFrame()) 606 if (render_frame_ && render_frame_->GetWebFrame())
601 return render_frame_->GetWebFrame()->document(); 607 return render_frame_->GetWebFrame()->document();
602 return WebDocument(); 608 return WebDocument();
603 } 609 }
604 610
605 } // namespace content 611 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698