| Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/ClearBrowsingDataTabCheckBoxPreference.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ClearBrowsingDataTabCheckBoxPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ClearBrowsingDataTabCheckBoxPreference.java
|
| index c56152af1387b20d7e95f1d7db810d7b82a4be71..9dabfe66aa2d0641c7f5bf3ba7cb634b6c19f404 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ClearBrowsingDataTabCheckBoxPreference.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ClearBrowsingDataTabCheckBoxPreference.java
|
| @@ -19,6 +19,7 @@ import android.widget.TextView;
|
|
|
| import org.chromium.base.ApiCompatibilityUtils;
|
| import org.chromium.chrome.R;
|
| +import org.chromium.chrome.browser.util.AccessibilityUtil;
|
| import org.chromium.ui.text.NoUnderlineClickableSpan;
|
| import org.chromium.ui.text.SpanApplier;
|
|
|
| @@ -51,7 +52,6 @@ public class ClearBrowsingDataTabCheckBoxPreference extends ClearBrowsingDataChe
|
|
|
| final TextView textView = (TextView) view.findViewById(android.R.id.summary);
|
|
|
| - // TODO(dullweber): Rethink how the link can be made accessible to TalkBack before launch.
|
| // Create custom onTouch listener to be able to respond to click events inside the summary.
|
| textView.setOnTouchListener(new View.OnTouchListener() {
|
| @Override
|
| @@ -95,13 +95,19 @@ public class ClearBrowsingDataTabCheckBoxPreference extends ClearBrowsingDataChe
|
|
|
| @Override
|
| public void setSummary(CharSequence summary) {
|
| - // If there is no link in the summary, invoke the default behavior.
|
| + // If there is no link in the summary invoke the default behavior.
|
| String summaryString = summary.toString();
|
| if (!summaryString.contains("<link>") || !summaryString.contains("</link>")) {
|
| super.setSummary(summary);
|
| return;
|
| }
|
| -
|
| + // Talkback users can't select links inside the summary because it is already a target
|
| + // that toggles the checkbox. Links will still be read out and users can manually
|
| + // navigate to them.
|
| + if (AccessibilityUtil.isAccessibilityEnabled()) {
|
| + super.setSummary(summaryString.replaceAll("</?link>", ""));
|
| + return;
|
| + }
|
| // Linkify <link></link> span.
|
| final SpannableString summaryWithLink = SpanApplier.applySpans(summaryString,
|
| new SpanApplier.SpanInfo("<link>", "</link>", new NoUnderlineClickableSpan() {
|
|
|