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

Unified Diff: content/browser/accessibility/browser_accessibility_manager_android.cc

Issue 681503002: Add Android AX functions to set the value and selection of a text field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@link_text_from_image
Patch Set: Add to supported actions Created 6 years, 2 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: content/browser/accessibility/browser_accessibility_manager_android.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager_android.cc b/content/browser/accessibility/browser_accessibility_manager_android.cc
index 3a31ff78edeea598a87aebf71cdee89c1214f5e4..ce279546ee617cf232e2dfc20737980e0f022aba 100644
--- a/content/browser/accessibility/browser_accessibility_manager_android.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_android.cc
@@ -224,6 +224,7 @@ jboolean BrowserAccessibilityManagerAndroid::PopulateAccessibilityNodeInfo(
node->IsCheckable(),
node->IsChecked(),
node->IsClickable(),
+ node->IsEditableText(),
node->IsEnabled(),
node->IsFocusable(),
node->IsFocused(),
@@ -406,6 +407,22 @@ void BrowserAccessibilityManagerAndroid::ScrollToMakeNodeVisible(
ScrollToMakeVisible(*node, gfx::Rect(node->GetLocation().size()));
}
+void BrowserAccessibilityManagerAndroid::SetTextFieldValue(
+ JNIEnv* env, jobject obj, jint id, jstring value) {
+ BrowserAccessibility* node = GetFromID(id);
+ if (node) {
+ BrowserAccessibilityManager::SetValue(
+ *node, base::android::ConvertJavaStringToUTF16(env, value));
+ }
+}
+
+void BrowserAccessibilityManagerAndroid::SetSelection(
+ JNIEnv* env, jobject obj, jint id, jint start, jint end) {
+ BrowserAccessibility* node = GetFromID(id);
+ if (node)
+ SetTextSelection(*node, start, end);
+}
+
void BrowserAccessibilityManagerAndroid::HandleHoverEvent(
BrowserAccessibility* node) {
JNIEnv* env = AttachCurrentThread();

Powered by Google App Engine
This is Rietveld 408576698