OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/accessibility/browser_accessibility.h" | 5 #include "content/browser/accessibility/browser_accessibility.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin()); | 513 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin()); |
514 | 514 |
515 return bounds; | 515 return bounds; |
516 } | 516 } |
517 | 517 |
518 base::string16 BrowserAccessibility::GetValue() const { | 518 base::string16 BrowserAccessibility::GetValue() const { |
519 base::string16 value = GetString16Attribute(ui::AX_ATTR_VALUE); | 519 base::string16 value = GetString16Attribute(ui::AX_ATTR_VALUE); |
520 // Some screen readers like Jaws and older versions of VoiceOver require a | 520 // Some screen readers like Jaws and older versions of VoiceOver require a |
521 // value to be set in text fields with rich content, even though the same | 521 // value to be set in text fields with rich content, even though the same |
522 // information is available on the children. | 522 // information is available on the children. |
523 if (value.empty() && (IsSimpleTextControl() || IsRichTextControl())) | 523 if (value.empty() && |
| 524 (IsSimpleTextControl() || IsRichTextControl()) && |
| 525 !IsNativeTextControl()) |
524 value = GetInnerText(); | 526 value = GetInnerText(); |
525 return value; | 527 return value; |
526 } | 528 } |
527 | 529 |
528 int BrowserAccessibility::GetLineStartBoundary( | 530 int BrowserAccessibility::GetLineStartBoundary( |
529 int start, | 531 int start, |
530 ui::TextBoundaryDirection direction, | 532 ui::TextBoundaryDirection direction, |
531 ui::AXTextAffinity affinity) const { | 533 ui::AXTextAffinity affinity) const { |
532 DCHECK_GE(start, 0); | 534 DCHECK_GE(start, 0); |
533 DCHECK_LE(start, static_cast<int>(GetText().length())); | 535 DCHECK_LE(start, static_cast<int>(GetText().length())); |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 } | 1218 } |
1217 } | 1219 } |
1218 | 1220 |
1219 node = container; | 1221 node = container; |
1220 } | 1222 } |
1221 | 1223 |
1222 return gfx::ToEnclosingRect(bounds); | 1224 return gfx::ToEnclosingRect(bounds); |
1223 } | 1225 } |
1224 | 1226 |
1225 } // namespace content | 1227 } // namespace content |
OLD | NEW |