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

Unified Diff: content/browser/accessibility/browser_accessibility_android.cc

Issue 303113003: Properly prioritize the sources of an accessible name on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_android.cc
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc
index cec0a664cdab41d4359171680289c0390aaeb6fe..7b88246d3cb20877a13c9af36ea214b97dc743f7 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -269,11 +269,18 @@ base::string16 BrowserAccessibilityAndroid::GetText() const {
}
base::string16 description = GetString16Attribute(ui::AX_ATTR_DESCRIPTION);
+ base::string16 help = GetString16Attribute(ui::AX_ATTR_HELP);
+ int title_elem_id = GetIntAttribute(
+ ui::AX_ATTR_TITLE_UI_ELEMENT);
base::string16 text;
- if (!name().empty())
- text = base::UTF8ToUTF16(name());
- else if (!description.empty())
+ if (!description.empty())
text = description;
+ else if (title_elem_id && !name().empty())
aboxhall 2014/05/30 21:26:21 I don't follow this logic. Why isn't it getting th
dmazzoni 2014/05/30 22:03:33 I added a comment. I need to clean this up in Blin
+ text = base::UTF8ToUTF16(name());
+ else if (!help.empty())
+ text = help;
+ else if (!name().empty())
+ text = base::UTF8ToUTF16(name());
else if (!value().empty())
text = base::UTF8ToUTF16(value());

Powered by Google App Engine
This is Rietveld 408576698