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

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

Issue 67473013: Support KitKat accessibility APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add dummy Mac and Win expectations Created 7 years 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 7cd6e855650af11d5f6c69a1cf84dda8cd95e6b5..63f461c8594ef8acac9e83486409fefffabf0d04 100644
--- a/content/browser/accessibility/browser_accessibility_manager_android.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_android.cc
@@ -229,6 +229,40 @@ jboolean BrowserAccessibilityManagerAndroid::PopulateAccessibilityNodeInfo(
absolute_rect.width(), absolute_rect.height(),
is_root);
+ // New KitKat APIs
+ Java_BrowserAccessibilityManager_setAccessibilityNodeInfoKitKatAttributes(
+ env, obj, info,
+ node->CanOpenPopup(),
+ node->IsContentInvalid(),
+ node->IsDismissable(),
+ node->IsMultiLine(),
+ node->AndroidInputType(),
+ node->AndroidLiveRegionType());
+ if (node->IsCollection()) {
+ Java_BrowserAccessibilityManager_setAccessibilityNodeInfoCollectionInfo(
+ env, obj, info,
+ node->RowCount(),
+ node->ColumnCount(),
+ node->IsHierarchical());
+ }
+ if (node->IsCollectionItem() || node->IsHeading()) {
+ Java_BrowserAccessibilityManager_setAccessibilityNodeInfoCollectionItemInfo(
+ env, obj, info,
+ node->RowIndex(),
+ node->RowSpan(),
+ node->ColumnIndex(),
+ node->ColumnSpan(),
+ node->IsHeading());
+ }
+ if (node->IsRangeType()) {
+ Java_BrowserAccessibilityManager_setAccessibilityNodeInfoRangeInfo(
+ env, obj, info,
+ node->AndroidRangeType(),
+ node->RangeMin(),
+ node->RangeMax(),
+ node->RangeCurrentValue());
+ }
+
return true;
}
@@ -282,6 +316,40 @@ jboolean BrowserAccessibilityManagerAndroid::PopulateAccessibilityEvent(
break;
}
+ // Backwards-compatible fallback for new KitKat APIs.
+ Java_BrowserAccessibilityManager_setAccessibilityEventKitKatAttributes(
+ env, obj, event,
+ node->CanOpenPopup(),
+ node->IsContentInvalid(),
+ node->IsDismissable(),
+ node->IsMultiLine(),
+ node->AndroidInputType(),
+ node->AndroidLiveRegionType());
+ if (node->IsCollection()) {
+ Java_BrowserAccessibilityManager_setAccessibilityEventCollectionInfo(
+ env, obj, event,
+ node->RowCount(),
+ node->ColumnCount(),
+ node->IsHierarchical());
+ }
+ if (node->IsCollectionItem() || node->IsHeading()) {
+ Java_BrowserAccessibilityManager_setAccessibilityEventCollectionItemInfo(
+ env, obj, event,
+ node->RowIndex(),
+ node->RowSpan(),
+ node->ColumnIndex(),
+ node->ColumnSpan(),
+ node->IsHeading());
+ }
+ if (node->IsRangeType()) {
+ Java_BrowserAccessibilityManager_setAccessibilityEventRangeInfo(
+ env, obj, event,
+ node->AndroidRangeType(),
+ node->RangeMin(),
+ node->RangeMax(),
+ node->RangeCurrentValue());
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698