Commit e5a5ea3a authored by Jaeyong Bae's avatar Jaeyong Bae Committed by Commit Bot

[Passwords] Set TYPE_TEXT_VARIATION_VISIBLE_PASSWORD on the text view

This patch means using font that allows to distinguish otherwise
indistinguishable characters. e.g between O and 0 or l and 1.

For this one, fonts that are applied on different platforms:
macOS - Menlo
Windows - Consolas
Chrome OS - DejaVu Sans Mono
Linux - DejaVu Sans Mono

while Roboto Mono is not among the TextAppearances that Chrome
on Android specifies, we can use
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD on the text view to get a
similar result.

Bug: 768825
Change-Id: I87146a61a8d8d681f04cbe69fd9403327f1c21c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490325
Commit-Queue: Jaeyong Bae <jdragon.bae@gmail.com>
Reviewed-by: default avatarIoana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822018}
parent e94db9af
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.password_manager; package org.chromium.chrome.browser.password_manager;
import android.content.Context; import android.content.Context;
import android.text.InputType;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -38,6 +39,9 @@ public class PasswordGenerationDialogCustomView extends LinearLayout { ...@@ -38,6 +39,9 @@ public class PasswordGenerationDialogCustomView extends LinearLayout {
public void setGeneratedPassword(String generatedPassword) { public void setGeneratedPassword(String generatedPassword) {
mGeneratedPasswordTextView.setText(generatedPassword); mGeneratedPasswordTextView.setText(generatedPassword);
mGeneratedPasswordTextView.setInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
| InputType.TYPE_TEXT_FLAG_MULTI_LINE);
} }
public void setSaveExplanationText(String saveExplanationText) { public void setSaveExplanationText(String saveExplanationText) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment