| Index: chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
|
| index 9fe5e1a2494e2550a78b3c4e092dc09208ed478f..f9babe28b976843a29d9bbbe15af0daae8715e92 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
|
| @@ -63,14 +63,23 @@ public class EmptyAlertEditText extends AppCompatEditText {
|
| }
|
|
|
| /**
|
| + *Checks whether the content is empty. Note that this doesn't update an error message.
|
| + * @return Whether the content is empty.
|
| + */
|
| + public boolean isValid() {
|
| + return getTrimmedText().length() > 0;
|
| + }
|
| +
|
| + /**
|
| * Checks whether the content is empty. If empty, an alert message will be shown.
|
| * @return Whether the content is empty.
|
| */
|
| public boolean validate() {
|
| - if (getTrimmedText().length() == 0) {
|
| + if (isValid()) {
|
| + return true;
|
| + } else {
|
| setError(mAlertMessage);
|
| return false;
|
| }
|
| - return true;
|
| }
|
| }
|
|
|