Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java

Issue 2762123006: Android Autofill Accessibility, Phase I (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698