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

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

Issue 2762123006: Android Autofill Accessibility, Phase I (Closed)
Patch Set: Move kAndroidAutofillAccessibility feature under OS_ANDROID. 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
« no previous file with comments | « no previous file | chrome/browser/about_flags.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2aa55b5b41c5f442b52e0b5ad27366d11d6a38f4 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,12 @@ 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.ui.DropdownItem;
import org.chromium.ui.base.WindowAndroid;
@@ -30,6 +32,7 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On
private final AutofillPopup mAutofillPopup;
private AlertDialog mDeletionDialog;
private final Context mContext;
+ private BrowserAccessibilityManager mBrowserAccessibilityManager;
public AutofillPopupBridge(View anchorView, long nativeAutofillPopupViewAndroid,
WindowAndroid windowAndroid) {
@@ -49,6 +52,9 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On
} else {
mAutofillPopup = new AutofillPopup(activity, anchorView, this);
mContext = activity;
+ mBrowserAccessibilityManager = ((ChromeActivity) activity)
+ .getCurrentContentViewCore()
+ .getBrowserAccessibilityManager();
}
}
@@ -87,6 +93,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 +114,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(mAutofillPopup.getListView());
+ }
+ }
}
@CalledByNative
« no previous file with comments | « no previous file | chrome/browser/about_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698