Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java |
index 20a422c71d2963a14300ec6a59b6f933bd124b90..08ccd3f6978d12e1a7a3b1a38b93ffc604ba8d6e 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java |
@@ -14,10 +14,13 @@ import android.view.View; |
import org.chromium.base.annotations.CalledByNative; |
import org.chromium.base.annotations.JNINamespace; |
import org.chromium.chrome.R; |
+import org.chromium.chrome.browser.ChromeActivity; |
import org.chromium.chrome.browser.ResourceId; |
import org.chromium.components.autofill.AutofillDelegate; |
import org.chromium.components.autofill.AutofillPopup; |
import org.chromium.components.autofill.AutofillSuggestion; |
+import org.chromium.content.browser.accessibility.BrowserAccessibilityManager; |
+import org.chromium.content.browser.ContentViewCore; |
import org.chromium.ui.DropdownItem; |
import org.chromium.ui.base.WindowAndroid; |
@@ -30,6 +33,7 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On |
private final AutofillPopup mAutofillPopup; |
private AlertDialog mDeletionDialog; |
private final Context mContext; |
+ private BrowserAccessibilityManager mBrowserAccessibilityManager = null; |
public AutofillPopupBridge(View anchorView, long nativeAutofillPopupViewAndroid, |
WindowAndroid windowAndroid) { |
@@ -49,6 +53,9 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On |
} else { |
mAutofillPopup = new AutofillPopup(activity, anchorView, this); |
mContext = activity; |
+ ChromeActivity chromeActivity = (ChromeActivity) activity; |
+ ContentViewCore contentViewCore = chromeActivity.getCurrentContentViewCore(); |
+ mBrowserAccessibilityManager = contentViewCore.getBrowserAccessibilityManager(); |
} |
} |
@@ -87,6 +94,9 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On |
private void dismiss() { |
if (mAutofillPopup != null) mAutofillPopup.dismiss(); |
if (mDeletionDialog != null) mDeletionDialog.dismiss(); |
+ if (mBrowserAccessibilityManager != null) { |
+ mBrowserAccessibilityManager.OnAutofillPopupDismissed(); |
+ } |
} |
/** |
@@ -105,8 +115,13 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On |
@CalledByNative |
private void show(AutofillSuggestion[] suggestions, boolean isRtl, int backgroundColor, |
int dividerColor, int dropdownItemHeight, int margin) { |
- if (mAutofillPopup != null) mAutofillPopup.filterAndShow(suggestions, isRtl, |
- backgroundColor, dividerColor, dropdownItemHeight, margin); |
+ if (mAutofillPopup != null) { |
+ mAutofillPopup.filterAndShow( |
+ suggestions, isRtl, backgroundColor, dividerColor, dropdownItemHeight, margin); |
+ if (mBrowserAccessibilityManager != null) { |
+ mBrowserAccessibilityManager.OnAutofillPopupDisplayed(); |
dmazzoni
2017/03/22 16:13:54
Would it make sense to pass the pop-up View to Bro
csashi
2017/03/24 01:32:23
Done.
|
+ } |
+ } |
} |
@CalledByNative |