| 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 532a40d86ca0c4339530dd796bc3572cbd7714ea..8ea3c5639b5e3899fa780113d30748b41f0d9744 100644
|
| --- a/content/browser/accessibility/browser_accessibility_android.cc
|
| +++ b/content/browser/accessibility/browser_accessibility_android.cc
|
| @@ -330,17 +330,16 @@
|
|
|
| // First, always return the |value| attribute if this is an
|
| // input field.
|
| - base::string16 value = GetString16Attribute(ui::AX_ATTR_VALUE);
|
| - if (!value.empty()) {
|
| + if (!value().empty()) {
|
| if (HasState(ui::AX_STATE_EDITABLE))
|
| - return value;
|
| + return base::UTF8ToUTF16(value());
|
|
|
| switch (GetRole()) {
|
| case ui::AX_ROLE_COMBO_BOX:
|
| case ui::AX_ROLE_POP_UP_BUTTON:
|
| case ui::AX_ROLE_TEXT_AREA:
|
| case ui::AX_ROLE_TEXT_FIELD:
|
| - return value;
|
| + return base::UTF8ToUTF16(value());
|
| }
|
| }
|
|
|
| @@ -357,9 +356,8 @@
|
| // Always prefer visible text if this is a link. Sites sometimes add
|
| // a "title" attribute to a link with more information, but we can't
|
| // lose the link text.
|
| - base::string16 name = GetString16Attribute(ui::AX_ATTR_NAME);
|
| - if (!name.empty() && GetRole() == ui::AX_ROLE_LINK)
|
| - return name;
|
| + if (!name().empty() && GetRole() == ui::AX_ROLE_LINK)
|
| + return base::UTF8ToUTF16(name());
|
|
|
| // If there's no text value, the basic rule is: prefer description
|
| // (aria-labelledby or aria-label), then help (title), then name
|
| @@ -385,16 +383,16 @@
|
| base::string16 text;
|
| if (!description.empty())
|
| text = description;
|
| - else if (title_elem_id && !name.empty())
|
| - text = name;
|
| + else if (title_elem_id && !name().empty())
|
| + text = base::UTF8ToUTF16(name());
|
| else if (!help.empty())
|
| text = help;
|
| - else if (!name.empty())
|
| - text = name;
|
| + else if (!name().empty())
|
| + text = base::UTF8ToUTF16(name());
|
| else if (!placeholder.empty())
|
| text = placeholder;
|
| - else if (!value.empty())
|
| - text = value;
|
| + else if (!value().empty())
|
| + text = base::UTF8ToUTF16(value());
|
| else if (title_elem_id) {
|
| BrowserAccessibility* title_elem =
|
| manager()->GetFromID(title_elem_id);
|
| @@ -565,8 +563,7 @@
|
| }
|
|
|
| int BrowserAccessibilityAndroid::GetEditableTextLength() const {
|
| - base::string16 value = GetString16Attribute(ui::AX_ATTR_VALUE);
|
| - return value.length();
|
| + return value().length();
|
| }
|
|
|
| int BrowserAccessibilityAndroid::AndroidInputType() const {
|
| @@ -834,10 +831,9 @@
|
| BrowserAccessibility::OnDataChanged();
|
|
|
| if (IsEditableText()) {
|
| - base::string16 value = GetString16Attribute(ui::AX_ATTR_VALUE);
|
| - if (value != new_value_) {
|
| + if (base::UTF8ToUTF16(value()) != new_value_) {
|
| old_value_ = new_value_;
|
| - new_value_ = value;
|
| + new_value_ = base::UTF8ToUTF16(value());
|
| }
|
| }
|
|
|
|
|