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

Side by Side Diff: content/browser/accessibility/browser_accessibility.cc

Issue 2833843005: Handling of different types of empty alt (Closed)
Patch Set: Ready to land Created 3 years, 7 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 (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 #include <iterator> 10 #include <iterator>
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 } 1016 }
1017 } 1017 }
1018 1018
1019 // Indicates if this object is at the root of a rich edit text control. 1019 // Indicates if this object is at the root of a rich edit text control.
1020 bool BrowserAccessibility::IsRichTextControl() const { 1020 bool BrowserAccessibility::IsRichTextControl() const {
1021 return HasState(ui::AX_STATE_RICHLY_EDITABLE) && 1021 return HasState(ui::AX_STATE_RICHLY_EDITABLE) &&
1022 (!PlatformGetParent() || 1022 (!PlatformGetParent() ||
1023 !PlatformGetParent()->HasState(ui::AX_STATE_RICHLY_EDITABLE)); 1023 !PlatformGetParent()->HasState(ui::AX_STATE_RICHLY_EDITABLE));
1024 } 1024 }
1025 1025
1026 bool BrowserAccessibility::HasExplicitlyEmptyName() const {
1027 return GetIntAttribute(ui::AX_ATTR_NAME_FROM) ==
1028 ui::AX_NAME_FROM_ATTRIBUTE_EXPLICITLY_EMPTY;
1029 }
1030
1026 std::string BrowserAccessibility::ComputeAccessibleNameFromDescendants() { 1031 std::string BrowserAccessibility::ComputeAccessibleNameFromDescendants() {
1027 std::string name; 1032 std::string name;
1028 for (size_t i = 0; i < InternalChildCount(); ++i) { 1033 for (size_t i = 0; i < InternalChildCount(); ++i) {
1029 BrowserAccessibility* child = InternalGetChild(i); 1034 BrowserAccessibility* child = InternalGetChild(i);
1030 std::string child_name; 1035 std::string child_name;
1031 if (child->GetStringAttribute(ui::AX_ATTR_NAME, &child_name)) { 1036 if (child->GetStringAttribute(ui::AX_ATTR_NAME, &child_name)) {
1032 if (!name.empty()) 1037 if (!name.empty())
1033 name += " "; 1038 name += " ";
1034 name += child_name; 1039 name += child_name;
1035 } else if (!child->HasState(ui::AX_STATE_FOCUSABLE)) { 1040 } else if (!child->HasState(ui::AX_STATE_FOCUSABLE)) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 return gfx::kNullAcceleratedWidget; 1199 return gfx::kNullAcceleratedWidget;
1195 } 1200 }
1196 1201
1197 bool BrowserAccessibility::AccessibilityPerformAction( 1202 bool BrowserAccessibility::AccessibilityPerformAction(
1198 const ui::AXActionData& data) { 1203 const ui::AXActionData& data) {
1199 NOTREACHED(); 1204 NOTREACHED();
1200 return false; 1205 return false;
1201 } 1206 }
1202 1207
1203 } // namespace content 1208 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility.h ('k') | content/browser/accessibility/browser_accessibility_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698